count char in input, v.3