#!/usr/bin/env python3

n, ans = int(input()), 0
while True:
    if ans * (ans + 1) // 2 > n:
        exit(print(ans - 1))
    ans += 1
