import sys import pypyjit import itertools import heapq import math from collections import deque, defaultdict import bisect input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) pypyjit.set_param('max_unroll_recursion=-1') N = int(input()) if N == 1 or N == 4: print(-1) elif N & 1 or N % 4 == 0: print(1) else: print(-1)