#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>N; int i2800=0; y=0; FOR(i,2800) { y++; if(x%400 || (x%100!=0 &&x%4==0)) y++; if(y%7==0) i2800++; } ll dif=N-2014; ll ret=dif/2800*i2800; N -= dif/2800*2800; y=1; for(x=2015;x<=N;x++) { if(y%7==0) ret++; y++; if(x%400 || (x%100!=0 &&x%4==0)) y++; } cout<