#include<iostream>
using namespace std;
int year(int m);
int main()
{int yea;
cin>>yea;
if (year(yea)==1)
cout<<29;
else
cout<<28;
return 0;}
int year(int m)
{if(m%4==0&&m%100!=0||m%400==0)
return 1;}
using namespace std;
int year(int m);
int main()
{int yea;
cin>>yea;
if (year(yea)==1)
cout<<29;
else
cout<<28;
return 0;}
int year(int m)
{if(m%4==0&&m%100!=0||m%400==0)
return 1;}