Measurement of the cosmic ray hadron spectrum up to 30 TeV at mountain altitude: the primary proton spectrum