#include #include #include using namespace std; #define RREP(i,s,e) for (i = e-1; i >= s; i--) #define rrep(i,n) RREP(i,0,n) #define REP(i,s,e) for (i = s; i < e; i++) #define rep(i,n) REP(i,0,n) #define INF 1e8 typedef long long ll; int main() { int i, d, cnt, ans; ll n; cin >> n; cnt = d = 0; rep (i,400) { int y = i + 2015; if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) d += 2; else d++; if (d % 7 == 0) cnt++; if ((n - 2015) % 400 == i) ans = cnt; } ans += (n - 2015) / 400 * cnt; cout << ans << endl; return 0; }