count the input characters