import java.io.BufferedReader; import java.io.InputStreamReader; /** * ツェラーの公式だかってやつで年月日が分かると曜日が分かるやつ * */ public class No087 { private static final int WED = 3; public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); long y_end = Long.parseLong(br.readLine()); long Y; int m = 7; int d = 23; long C; long ganma; long D = 0; long b = (y_end - 2014) / 400; long count = b * 57; for (long i = 2015 + b * 400; i <= y_end; i++) { Y = i % 100; C = i / 100; ganma = (5 * C) + C / 4; D = ((d + ((26 * (m + 1)) / 10 + Y + Y / 4 + ganma + 5)) % 7) + 1; if (D == WED) { count++; } } System.out.println(count); br.close(); } catch (Exception e) { System.err.println("Error:" + e.getMessage()); } } }