import java.io.*;
import java.util.*;

public class MaartenLinear {
    public static void main(String[] args) throws IOException {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            new MaartenLinear().run(new Scanner(reader));
        }
    }

    public void run(Scanner sc) throws IOException {
        long n = sc.nextLong();
        for (long ans = 0;; ans++) {
            if (ans * (ans + 1) / 2 > n) {
                System.out.println(ans - 1);
                return;
            }
        }
    }
}
