count the input characters v2