import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Comparator; import java.util.Deque; import java.util.HashMap; import java.util.PriorityQueue; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); static final int INF=Integer.MAX_VALUE/2; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty()){ int n=Integer.parseInt(line); int dif=0; for(int i=2015;i<=n;i++){ if(i%400==0) dif+=2; else if(i%100==0) dif++; else if(i%4==0) dif+=2; else dif++; } int t=dif/7; out.println(t); out.flush(); } } static class Pair{ int x; int y; Pair(int x,int y){ this.x=x; this.y=y; } } static class Edge{ int from; int to; int cost; Edge(int from,int to,int cost){ this.from=from; this.to=to; this.cost=cost; } Edge(int to,int cost){ this.to=to; this.cost=cost; } } static class Node{ int d; int v; Node(int d,int v){ this.d=d; this.v=v; } final static Comparator DISTANCE_ORDER=new DistanceOrderComparator(); static class DistanceOrderComparator implements Comparator{ public int compare(Node n1,Node n2){ return (n1.d>n2.d)?1:(n1.d