#!/bin/python import sys n = int(raw_input().strip()) for i in range(1,n): for j in range(1,n): a,b,x,y,count=i,j,0,0,0 while(xn and y+an: x=x+b y=y-a count+=1 elif x+a>n and y+b=n: x=x+a y=y-b count+=1 elif (x==n-1 and y==n-1): print count, break else: print -1, break else: print