a, b = io.read("*n", "*n") if b < a then a, b = b, a end if a + 4 == b then print((b + 4) % 12) else print((a + 4) % 12) end