#include <bits/stdc++.h> using namespace std; int M[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int main() { int y = 2000, m = 1, d = 1, w = 6, ans = 2; while (y != 2020 || m != 10 || d != 1) { if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) M[2] = 29; else M[2] = 28; d++; w = (w + 1) % 7; if (d > M[m]) { d = 1; m++; if (m > 12) { y++; m = 1; } } if (d == 1 || w == 1) ans++; ans++; } cout << ans; }