S = input() if int(S[-1]) % 2 == 1: print(1) elif S != "4" and int(S[-2:]) % 4 == 0: print(1) else: print(-1)