import java.util.GregorianCalendar; public class Main { public static void main(String[] args) throws Exception { // Scanner sc = new Scanner(System.in); //int a = sc.nextInt(); //int b = sc.nextInt(); GregorianCalendar calendar = new GregorianCalendar(2015, 0, 31); GregorianCalendar endDay = new GregorianCalendar(2015, 11, 31); int count = 0; int d10 = 0; int d1 = 0; for (int i = 1; i <= 365; i++ ) { int m = calendar.get(calendar.MONTH); int d = calendar.get(calendar.DATE); if (d > 9) { d10 = d/10; d1 = d%10; } else { d1 = d; } if (m == d10 + d1) { count++; } calendar.add(calendar.DATE, 1); } System.out.println(count); } }