import sys
import math
n = int(input())
l = int((-1 + math.sqrt(1 + 4 * n)) / 2)
print(l)