calculate number of POST fields properly