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)); int y_end = Integer.parseInt(br.readLine()); int Y; int m = 7; int d = 23; int C; int ganma; int D = 0; int count = 0; for (int i = 2015; i <= y_end; i++) { Y = i % 100; C = i / 100; ganma = -2 * C + C / 4; D = (d + ((26 * (m + 1)) / 10 + Y + Y / 4 + ganma + 5)) % 7 + 1; if (D == WED) { count++; } } System.out.println(count); } catch (Exception e) { System.err.println("Error:" + e.getMessage()); } } }