import sys input = sys.stdin.readline M,D=map(int,input().split()) if M<=7: print(23) elif M>=9: print(24) else: if D<=21: print(23) else: print(24)