import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()){ int n = sc.nextInt(); if(n==0 || Math.abs(n)==1){ System.out.println(n); return; } int location1 = -1, location2 = 1; int step = 2; n = Math.abs(n); System.out.println(Math.min(get(n,location1,step),get(n,location2,step))); } } static int get(int x, int location , int step){ while (location<x){ if(location+step>x){ location -= step; step++; }else if(location+step<x){ location += step; step++; }else { break; } } return step; } }