A new determination of the primary energy spectrum from EAS size measurements