#include <iostream>
using namespace std;
int main()
{
int nDaysInMonths[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int nYear = 1901;
int nMonth = 1;
int nDay = (1 + 365) % 7;
int nCount = 0;
while ( nYear <= 2000 )
{
if ( nDay == 0 )
{
++nCount;
}
nDay += nDaysInMonths[nMonth];
if ( (nMonth == 2) && (nYear % 400 == 0 || nYear % 100 != 0 && nYear % 4 == 0) )
{
++nDay;
}
nDay %= 7;
nMonth += 1;
if ( nMonth == 13 )
{
++nYear;
nMonth = 1;
}
}
cout << nCount << endl;
return 0;
}