#include using namespace std; enum DayOfWeek { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, }; int Zeller(int y, int m, int d) { if (m < 3) { y--; m += 12; } return (y + y / 4 - y / 100 + y / 400 + (13 * m + 8) / 5 + d) % 7; } int main() { DayOfWeek day_of_week_table[] = { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday }; int n; cin >> n; int count = 0; for (int year = 2015; year <= n; year++) { if (day_of_week_table[Zeller(year, 7, 23)] == Wednesday) count++; } cout << count << endl; system("pause"); return 0; }