count char in input, v.3.1