publicclassMain{ publicstaticvoidmain(String[] args){ Scanner in = new Scanner(System.in); String s = in.nextLine(); char c = in.next().charAt(0); char cc = Character.isLowerCase(c) ? Character.toUpperCase(c) : Character.toLowerCase(c); char[] ar = s.toCharArray(); int res = 0; for (char each : ar) { if (each == c || each == cc) { res ++; } } System.out.println(res); } }