https://www.acmicpc.net/problem/1568
bird_count = int(input())
left_bird_count = bird_count
second = 0
sound_count = 0
while left_bird_count > 0:
second += 1
sound_count += 1
# print(sound_count, left_bird_count)
if left_bird_count < sound_count:
sound_count = 1
left_bird_count -= sound_count
print(second)
n = int(input())
result = 0
k = 1
while n != 0:
if k > n:
k = 1
n -= k
k += 1
result += 1
print(result)