#include using namespace std; template istream &operator>>(istream &is,vector &a){ for(auto &v : a) cin >> v; return is; } template ostream &operator<<(ostream &os,const vector &a){ if(a.size() == 0) return os; cout << a.at(0); for(int i=1; i int { if(x%400 == 0) return 2; else if(x%100 == 0) return 1; else if(x%4 == 0) return 2; else return 1; }; long long N; cin >> N; long long s = 0,answer = 0; if(N <= 10000){ for(int i=2015; i<=N; i++){ s = (s+leap(i))%7; answer += s==0; } cout << answer << endl; return 0; } answer = 0,s = 0; for(int i=2015; i<4815; i++) s = (s+leap(i))%7,answer += s==0; long long left = N-4814; answer *= 1+left/2800; left %= 2800; for(int i=2015; i