So when you make your sum, you set your variable to add to itself every loop. This is done with something like
theSum = theSum + inputNumber
which it sounds like youve already done. so to keep track of how MANY numbers are being summed, you need another variable, which adds 1 to itself every loop. something like
y = y + 1
and then you just have to work out how to make it so that every time theSum is increased, your other variable increases by 1.