if (y%400 == 0) or (y%4 == 0 and y%100 != 0): print('29') else: print('28')
if m == 1 or 3 or 5 or 7 or 8 or 10 or 12: print('31') else: print('30')