n = int(input()) if n == 1 or n == 4: print(-1) exit() while n % 4 == 0: n //= 4 print(-1 if n % 2 == 0 else 1)