Counting positive and negative numbers and computing the average of numbers