import math n = int(input()) cnt = 0 if(n == 1): print(1) exit() r = int(math.sqrt(n)) ok = True if r * r == n: ok = False for i in range(2, int(math.sqrt(r))): if(r % (i + 1) == 0): ok = True while(n % 2 == 0): cnt += 1 n /= 2 if(cnt == 1): print(-1) else: if ok: print(1) else: print(-1)