x=int(input())
if(x==1):
print('31')
if(x==2):
print('28')
if(x==3):
if(x==4):
print('30')
if(x==5):
if(x==6):
if(x==7):
if(x==8):
if(x==9):
if(x==10):
if(x==11):
if(x==12):
month = int(input("Введите номер месяца: "))
if month == 1 or month == 3 or month == 5 or month == 8 or month == 7 or month == 12 or month == 10:
print(31)
elif month == 2:
print(28)
elif month == 4 or month == 6 or month == 9 or month == 11:
print(30)
else:
print("Введён неверный номер месяца")
x=int(input())
if(x==1):
print('31')
if(x==2):
print('28')
if(x==3):
print('31')
if(x==4):
print('30')
if(x==5):
print('31')
if(x==6):
print('30')
if(x==7):
print('31')
if(x==8):
print('31')
if(x==9):
print('30')
if(x==10):
print('31')
if(x==11):
print('30')
if(x==12):
print('31')
month = int(input("Введите номер месяца: "))
if month == 1 or month == 3 or month == 5 or month == 8 or month == 7 or month == 12 or month == 10:
print(31)
elif month == 2:
print(28)
elif month == 4 or month == 6 or month == 9 or month == 11:
print(30)
else:
print("Введён неверный номер месяца")