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