import sys input = sys.stdin.readline n, m = map(int, input().split()) flag = True lis = [*range(1, n + 1)][::-1] ans = 0 for k in lis: if(m >= k): m -= k flag = True continue if(flag): ans += 1 flag = False print(ans)