import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); scan.close(); int t = N - 2014; int h = zeller(2014, 7, 23); int cnt = 0; for(int i = 0; i < 400; i++) { if(h == zeller(2015 + i, 7, 23)) { cnt ++; } } int k = t / 400; int ans = k * cnt; int s = 2015 + k * 400; for(int i = s; i <= N; i++) { if(h == zeller(i, 7, 23)) { ans++; } } System.out.println(ans); } static int zeller(int y, int m, int d) { int t1 = d; int t2 = (26 * (m + 1)) / 10; int t3 = y % 100 + (y % 100) / 4; int t4 = 5 * (y / 100) + (y / 100) / 4; return (t1 + t2 + t3 + t4) % 7; } }