#!/usr/bin/env python # -*- coding: utf-8 -*- import sys # {{{ import os import time import re from pydoc import help import string import math from operator import itemgetter from collections import Counter from collections import deque from collections import defaultdict as dd import fractions from heapq import heappop, heappush, heapify import array from bisect import bisect_left, bisect_right, insort_left, insort_right from copy import deepcopy as dcopy import itertools # }}} # pre-defined{{{ sys.setrecursionlimit(10**7) INF = 10**20 GOSA = 1.0 / 10**10 MOD = 10**9+7 ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)] # can also use string module def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x) for x in sys.stdin.readline().split()] def LS(): return sys.stdin.readline().split() def I(): return int(sys.stdin.readline()) def F(): return float(sys.stdin.readline()) def DP(N, M, first): return [[first] * M for n in range(N)] def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)] from inspect import currentframe # }}} def solve(): n = int(input()) if (n%2 == 1): print(1) elif (n%4 == 0): print(1) else: print(-1) return 0 if __name__ == "__main__":# {{{ solve() # vim: set foldmethod=marker: }}}