import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.lang.Math; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = null; while((str = in.readLine()) != null){ long h = Long.parseLong(str); long delta = (int)Math.sqrt(1 + 4*h); System.out.println((delta - 1) / 2); }
}
}