deffunc(n): return n * (n + 1) // 2; defhelper(n, m, mid): k = n + (mid - m) * m; eat = func(mid) - func(m - 1); return k - eat; defsolve(n, m): if n <= m: return n; l = m r = 10**18 res = 10**18; while l <= r : mid = l + (r - l) // 2; s = helper(n,m,mid); if s <= 0: res = min(res, mid); r = mid - 1; else: l = mid + 1; return res; n, m = map(int,input().split()) print(solve(n,m))