move gitchar() into while loop statement
count the number of characters input by the user