N = int(input()) # 奇数なら 1 以外OK # 偶数なら 4 の倍数だったら 4 以外OK ans = -1 if N%2 == 1: if N != 1: ans = 1 else: if N%4 == 0: if N != 4: ans = 1 print(ans)