#!/usr/bin/env python3 """ Using high school algebra to invert k \mapsto k * (k - 1)/2, we arrive at h = \lfloor \frac{ -1 \pm \sqrt{ 1 + 8 k }{2} \rfloor """ import math def invert_formula(n) -> float: # return the positive root a = 1 b = 1 c = -2 * n discriminant = b**2 - 4 * a * c assert discriminant >= 0 root1 = (-b + math.sqrt(discriminant)) / (2 * a) root2 = (-b - math.sqrt(discriminant)) / (2 * a) return max(root1, root2) print(math.floor(invert_formula(int(input()))))