def age(M, D): if M >= 9 or (M == 8 and D >=22): print(24) else: print(23) M,D = map(int, input(). split()) age(M, D)