import java.util.*; public class No3 { public static void main(String[] args){ Scanner sc =new Scanner(System.in); int N = sc.nextInt(); int list[] = new int[N + 15]; List q1 = new ArrayList(); // List q2 = new ArrayList0){ if(list[Num-one]==0){ count=count+1; list[Num-one]=count; q1.add(Num-one); } } if(Num+one<=N){ if(list[Num+one]==0){ count=count+1; list[Num+one]=count; q1.add(Num+one); } } } if(list[N]!=0){ System.out.println(list[N]); i = i+1; break; }else if(q1.isEmpty()){ System.out.println(-1); i = i+1; break; } } } }