Spectra of primary cosmic-ray positrons and electrons in the PAMELA experiment