Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
349 B
84
Indexable
Never

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		
		int n = sc.nextInt(); 
		int sum = 0; 
		int res = 0; 
		for(int i = 1; i <= n; i++) { 
			sum += i; 
			if(sum > n) { 
				res = i - 1;  
				break;
			}
		} 
		System.out.println(res);
	}
}