#include #define REP(i,n,N) for(int i=(n);i<(int)N;i++) #define p(s) cout<<(s)<> N; ll day = 0; ll after = N - 2014; ll ans = 0; ll mul = after/2800; ans += mul * 399; after %= 2800; REP(i,0,after){ int y = 2015 + i; if (y % 400 == 0) day += 366; else if (y % 100 == 0) day += 365; else if (y % 4 == 0) day += 366; else day += 365; if (day % 7 == 0) ans ++; } cout << ans << endl; return 0; }