#include <iostream>
using namespace std;
int res = 5 , xx;
int cnt[12] = {31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31};
bool is(int x) {
if(x % 400 == 0 || (x % 4 == 0 && x % 100 != 0)) return true;
return false;
}
int main()
{
for(int i = 2000 ; i < 2020 ; i ++ ) {
if(is(i)) cnt[1] = 29;
else cnt[1] = 28;
for(int j = 0 ; j < 12 ; j ++ ) {
for(int k = 1 ; k <= cnt[j] ; k ++ ) {
res ++;
if(res % 7 == 0 || k == 1) xx ++;
}
}
}
cnt[1] = 29;
for(int i = 0 ; i < 9 ; i ++ )
for(int j = 0 ; j < cnt[i] ; j ++ ) {
res ++;
if(res % 7 == 0 || j == 1) xx ++;
}
cout << res + xx ;
return 0;
}