BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String n1 = reader.readLine(); char ch = n1.charAt(0); int n = Character.getNumericValue(ch); if (n % 2 == 0){ even++; } else if (n % 2 ==1){ odd++; } System.out.println("Even: "+even+" Odd: "+odd); I'm not able to figure out how to check everyone number. I able to check just one. Tried to use for and while, but it was unsuccessful.