M,D = map(int,input().split()) if M == 4 and D == 1: print(1) print(M+D)