import sys input = lambda: sys.stdin.readline().rstrip() # ----------------------- # x, y = map(int, input().split()) if x > y: x, y = y, x z = (y + 4) % 12 print(z if z != x else (y+8)%12)