#include<iostream>
using namespace std;
int main()
{
	int year,month;
	cout<<"put the year and month"<<endl;
	cin>>year>>month;
	switch(month)
	{
	case 1:
	case 3:
	case 5:
	case 7:
	case 8:
	case 10:
	case 12:
		{
			cout<<"ÓÐ31Ìì"<<endl;
			return 0;
		}
	}
	if(month==2)
	{
		if ((year%400==0) || (year%100!=0) && (year%4==0)) 
		 {
			 cout<<"ÓÐ29Ìì"<<endl;
		 }
		else
		{
			cout<<"ÓÐ28Ìì"<<endl;
		}
		return 0;
	}
	cout<<"ÓÐ30Ìì"<<endl;
	return 0;
}