package CountString;
import sun.nio.ch.sctp.SctpNet;
import java.util.HashMap;
import java.util.Scanner;
import java.util.Set;
public class CountString {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("please input:");
String s = sc.nextLine();
HashMap<Character, Integer> hs = new HashMap<Character, Integer>();
for (int i = 0; i < s.length(); i++) {
char key = s.charAt(i);
System.out.println(key);
Integer value = hs.get(key);
if (value == null) {
hs.put(key, 1);
} else {
value++;
hs.put(key, value);
}
}
for (Character ch : hs.keySet()) {
Integer value = hs.get(ch);
System.out.println(ch + " " + value);
}
}
}