n, m = map(int, input().split()) if m == 0: print(5) else: print(4)