import java.util.Calendar; public class No188 { public static void main(String[] args) { Calendar cal = Calendar.getInstance(); Calendar end = Calendar.getInstance(); cal.set(2015, 0, 1); end.set(2015, 11, 31); cal.set(Calendar.MILLISECOND, 0); cal.set(Calendar.MILLISECOND, 0); int m, d10, d1, ans = 0; while(cal.compareTo(end) < 0){ m = cal.get(Calendar.MONTH) + 1; d10 = cal.get(Calendar.DATE) / 10; d1 = cal.get(Calendar.DATE) % 10; if(m == d10 + d1){ ans++; } cal.add(Calendar.DATE, 1); } System.out.println(ans); } }