#include #include #include #include #include #include #include #include #include #include #include #include #include #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() using namespace std; typedef long long ll; typedef pair pi; typedef pair pl; typedef pair pls; int uruu(int year){ if(year % 4 == 0){ if (year % 100 == 0) { if (year % 400 == 0) { return 1; } else return 0; } else return 1; } else return 0; } int main() { int N; cin >> N; ll sum = 0,ans = 0; for (int i = 2015; i <= N; i++) { if (uruu(N))sum += 366; else sum += 355; if (sum % 7 == 0)ans++; } cout << ans << endl; return 0; }