import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) throws FileNotFoundException { long t = System.currentTimeMillis(); new Main().run(); System.err.println(System.currentTimeMillis() - t); } long f(long K) { long n=(long)(Math.sqrt(2*K))+1; if(n*(n-1)==2*K)return n; else return -1; } void run() { Scanner sc = new Scanner(); long K=sc.nextLong(); long n=1; int p=0; while(f(K)==-1||f(K)+p>30) { if(K%2!=0)throw new AssertionError(); K/=2; ++p; } //n(n-1)/2*2^p=K; n=f(K); if(n*(n-1)/2!=K)throw new AssertionError(); System.out.println(n+p); for(int i=0;i