m, d = [ int(v) for v in input().split() ] if m == 4 and d == 1: print(0) else: print(m + d)