#include<bits/stdc++.h>
#define f(i,s,e) for(int i = s; i <= e; i++)
#define ll long long
using namespace std;
const int N = 1e3+10,inf = 0x3f3f3f3f;
int sum(int n)
{
int res = 0; //记录过去了多少天
f(i,2001,n - 1)
if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0)
res += 366;
else
res += 365;
return res;
}
int main()
{
int n; cin >> n;
int t = sum(n); //设计sum函数来计算2001年到第n年过去了多少天
int d = t % 7 + 1;
int m[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; //月份数组
if(n % 4 == 0 && n % 100 != 0 || n % 400 == 0) m[2] = 29; //闰年2月29天
int ri[13][31]; //日历 ri[i][j]:第i月的第j天是星期几
int y = 1,s = 1; //y月 s日
while(y <= 12)
{
ri[y][s] = d; //填充每月每日是星期几
d++;
if(d > 7) d = 1;
s++; //下一天
if(s > m[y]) //s超过了当月的天数,那么要下一月
{
y++,s = 1;
}
}
int ans = 0;
f(i,1,12)
if(ri[i][13] == 5) ans++;
cout << ans;
return 0;
}