#include using namespace std; typedef long long ll; int main(){ ll n; cin>>n; ll a,b,c,d,e,f,g,x,y,z; a=0; c=n-2015+1; f=0; if(c>=2800){ c%=2800; f=1; } x=0; y=0; for(int i=2015; i<2015+c; ++i){ d=365; if(i%4==0){ if(i%100==0){ if(i%400==0){ d=366; } } else { d=366; } } x+=d%7; if(x==0) y++; else if(x%7==0) y++; } if(f==1){ b=(n-2015+1)/2800; e=x; g=0; for(int i=1; i<=2800; ++i){ d=365; if(i%4==0){ if(i%100==0){ if(i%400==0){ d=366; } } else { d=366; } } e+=d%7; if(e%7==0) g++; } a=b*g; } z=y+a; cout<