import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; import java.util.TreeSet; public class Main { public static final int zeller(int y, int m, int d){ if(m <= 2){ y--; m+=12;} return (d + 26*(m+1)/10 + y + y/4 + 6*(y/100) + y/400) % 7; } public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int mod_2014 = zeller(2014, 7, 23); final int N = sc.nextInt(); int answer = 0; for(int i = 2015; i <= N; i++){ if(zeller(i, 7, 23) == mod_2014){ answer++; } } System.out.println(answer); } }