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