Determination of the neutron lifetime by counting trapped protons