import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong() - 2014; long res = 57 * (N / 400); // Zeller for (long i = 2015; i <= N % 400 + 2015; i++) if ((39 + 5 * (i % 100) / 4 + 21 * (i / 100) / 4) % 7 == 0) res++; System.out.println(res); } }