python3
import sys
import math

class solution:
    def my_input(self) -> int:
        for line in sys.stdin:
            num = int(line)
        return num
    
    def compute(self, num) -> int:
        # 解方程方法才不会超出时间限制
        l = int((-1 + math.sqrt(1 + 4 * num)) / 2)
        return l
            
if __name__ == '__main__':
    solution = solution()
    num = solution.my_input()
    print(solution.compute(num))