Anton likes to listen to fairy tales, especially when Danik, Anton's best friend, tells them. Right now Danik tells Anton a fairy tale:

"Once upon a time, there lived an emperor. He was very rich and had much grain. One day he ordered to build a huge barn to put there all his grain. Best builders were building that barn for three days and three nights. But they overlooked and there remained a little hole in the barn, from which every day sparrows came through. Here flew a sparrow, took a grain and flew away..."

More formally, the following takes place in the fairy tale. At the beginning of the first day the barn with the capacity of *n* grains was full. Then, every day (starting with the first day) the following happens:
 -  *m* grains are brought to the barn. If *m* grains doesn't fit to the barn, the barn becomes full and the grains that doesn't fit are brought back (in this problem we can assume that the grains that doesn't fit to the barn are not taken into account). -  Sparrows come and eat grain. In the *i*-th day *i* sparrows come, that is on the first day one sparrow come, on the second day two sparrows come and so on. Every sparrow eats one grain. If the barn is empty, a sparrow eats nothing. 
Anton is tired of listening how Danik describes every sparrow that eats grain from the barn. Anton doesn't know when the fairy tale ends, so he asked you to determine, by the end of which day the barn will become empty for the first time. Help Anton and write a program that will determine the number of that day!
The only line of the input contains two integers *n* and *m* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">18</sup>) — the capacity of the barn and the number of grains that are brought every day.
In the first sample the capacity of the barn is five grains and two grains are brought every day. The following happens:
 -  At the beginning of the first day grain is brought to the barn. It's full, so nothing happens. -  At the end of the first day one sparrow comes and eats one grain, so 5 - 1 = 4 grains remain. -  At the beginning of the second day two grains are brought. The barn becomes full and one grain doesn't fit to it. -  At the end of the second day two sparrows come. 5 - 2 = 3 grains remain. -  At the beginning of the third day two grains are brought. The barn becomes full again. -  At the end of the third day three sparrows come and eat grain. 5 - 3 = 2 grains remain. -  At the beginning of the fourth day grain is brought again. 2 + 2 = 4 grains remain. -  At the end of the fourth day four sparrows come and eat grain. 4 - 4 = 0 grains remain. The barn is empty. 
So the answer is 4, because by the end of the fourth day the barn becomes empty.
5 2
4
8 1
5
32 5
12
1024 1024
1024
58044 52909
53010
996478063 658866858
658892843
570441179141911871 511467058318039545
511467058661475480
1 1
1
1000000000000000000 1000000000000000000
1000000000000000000
1000000000000000000 999999999999997145
999999999999997221
1 1000000000000000000
1
1000000000000000000 1
1414213563
999999998765257149 10
1414213571
999999998765257150 10
1414213571
999999998765257151 10
1414213571
999999998765257152 10
1414213572
999999998765257153 10
1414213572
762078938126917521 107528
1234675418
762078938126917522 107528
1234675418
762078938126917523 107528
1234675418
762078938126917524 107528
1234675419
762078938126917525 107528
1234675419
443233170968441395 1048576
942571991
443233170968441396 1048576
942571991
443233170968441397 1048576
942571992
1833551251625340 1359260576251
1359321110406
1835002539467264 2810548418174
2810608952329
1840276176082280 8084185033189
8084245567345
262133107905 256256256256
256256364670
262133108160 256256256256
256256364670
262133108161 256256256256
256256364670
262133108162 256256256256
256256364671
399823373917798976 326385530977846185
326385531361089823
836052329491347820 327211774155929609
327211775164731428
870979176282270170 16
1319832715
930580173005562081 4
1364243511
831613653237860272 154
1289661856
867842613106376421 178
1317454248
939156247712499033 1902
1370517314
975385203286047886 1326
1396701153
953065701826839766 4023
1380631201
989294657400388618 7447
1406630820
885695753008586140 42775
1330979102
921924708582134992 158903
1358043072
802352815201515314 183504
1266953266
861953807629839929 1299632
1314276256
925155772916259712 1929889
1362191462
961384732784775860 5046017
1391685648
910494856396204496 39891744
1389332262
946723811969753348 17975168
1394001194
992316381103677158 1849603453
3258373398
828545340972193305 1027686877
2314967219
946697532222325132 16179805162
17555812078
982926487795873985 19357888587
20759977363
892753091050063317 2037020896
3373249237
928982046623612170 45215104320
46578175853
845950022554437217 1553155668877
1554456398264
882178982422953366 1792038785005
1793367075026
847407611288100389 9111983407070
9113285250762
883636566861649242 15350866523198
15352195899906
988545172809612094 126043487780965
126044893781768
824774128383160945 152286665864389
152287950093217
889067279135046636 783632221444127
783633554323452
925296230413628192 1609871104560255
1609872463741155
892888041747308306 15921193742955831
15921195067317449
929116997320857159 16747432626071959
16747433976901012
810365749050428005 176443295773423092
176443296899409285
846594708918944153 177269538951506516
177269540108507095
2 1
2
2 2
2
3 1
3
3 2
3
3 3
3
4 1
3
4 2
4
256 20
42
78520 8
404
1367064836 777314907868410435
1367064836
658866858 996478063
658866858
10 648271718824741275
10
326385530977846185 399823373917798976
326385530977846185
327211774155929609 836052329491347820
327211774155929609
2570 566042149577952145
2570
512486308421983105 512486308421983105
512486308421983105
262144 262144
262144
314159265358979323 314159265358979323
314159265358979323
16 5
10
29 16
21
24 14
18
28 18
22
8 11
8
500000000500004239 4242
1000004242
500000000500004240 4242
1000004242
500000000500004241 4242
1000004242
500000000500004242 4242
1000004242
500000000500004243 4242
1000004243
500000000500004244 4242
1000004243
500000000500004245 4242
1000004243
163162808800191208 163162808800191206
163162808800191208
328584130811799021 328584130811799020
328584130811799021
89633000579612779 89633000579612778
89633000579612779
924211674273037668 924211674273037666
924211674273037668
758790352261429854 758790352261429851
758790352261429853
39154349371830603 39154349371830597
39154349371830600
313727604417502165 313727604417502155
313727604417502159
1000000000000000000 999999999999999999
1000000000000000000
1000000000000000000 999999999999999998
1000000000000000000
1000000000000000000 999999999999999997
999999999999999999
1000000000000000000 999999999999999996
999999999999999999
1000000000000000000 999999999999999995
999999999999999998
1 5
1
1 100
1
1 3
1
6 9
6
1000000000000000000 2
1414213564
1 10
1
5 15
5
12 1
6
1000000000000000000 100000000000000000
100000001341640786
100 200
100
1 1000000000000000
1
100000000000000000 1
447213596
1000000000000000000 1000000000000000
1000001413506279
1 9
1
1000000000000000000 4
1414213566
1000000000000 10000000000000
1000000000000
1 100000
1
3 7
3
2 3
2
1 8
1
5 10
5
10 11
10
10 100
10
5 16
5
2 10
2
10836 16097
10836
16808 75250
16808
900000000000169293 1
1341640788
1 10000000
1
2 100
2
10 20
10
10 10000
10
4 5
4
1 2
1
1000000000000000000 5
1414213567
2 5
2
4 6
4
999999998765257147 1
1414213563
3 10
3
997270248313594436 707405570208615798
707405570970015402
1 100000000000
1
6 1000000
6
16808 282475250
16808
1000000007 100000000000007
1000000007
1 1000
1
1000000000000000 10000000000000000
1000000000000000
1000000000000000000 100
1414213662
1000000000000000000 9
1414213571
900000000000169293 171
1341640957
1 999999999999
1
10000 10000000000000
10000
1 9999999999999
1
695968090125646936 429718492544794353
429718493274519777
2 5000
2
8 100
8
2 7
2
999999999999999999 1
1414213563
5 8
5
1000000000000000000 99999999999999999
100000001341640785
100000000000000000 100000000000000000
100000000000000000
5 6
5
1000000000000000000 1000000000
2414213562
1 10000
1
22 11
16
10 10000000
10
3 8
3
10 123123
10
3 5
3
1000000000000000000 10
1414213572
10000000000000 45687987897897
10000000000000
5 4
5
5000 123456789
5000
7 100
7
1000000000000000000 500000000000
501414213209
8 7
8
1 10000000000
1
1000000000000000000 15
1414213577
1 123456789
1
2 1000
2
5 11
5
1 1000000000
1
1000000000000000000 499999999999999999
500000000999999999
1 100000000
1
619768314833382029 108339531052386197
108339532063750408
5 100
5
2 10000
2
1000000000000000000 500000000000000000
500000001000000000
143 3
20
2 6
2
100 1000000000
100
2 100000000000000000
2
100000000000000000 1000000000000000000
100000000000000000
999999999999999999 123456789
1537670351
1 99999
1
1000000000000000000 9999999999
11414213554
5 100000000000000000
5
6 999999
6
100 10000000
100
4 100
4
1000000000 1000000000000000
1000000000
10 100000
10
5 15555555
5
5 155555
5
200 9999999999
200
3 200
3
1000000000000000000 490000000000000000
490000001009950494
2 4
2
5 15555
5
5 7
5
10040 200000
10040
1000000000000000000 60000000000000000
60000001371130920
10 1000000000000
10
1 45
1
import math
#常数n代表谷仓容量，m代表每天进货，i,a（具有同等效力）代表天数，k代表每日剩余
n,m=input().split()
k,i=int(n),1
a=1
c=int(m)
#Guess：由于m可能过大，现对m取log(base 2)，分别将商部和余部放在b和c中以减少计算量
b=int(math.log2(int(m)))
c=int(m)-int(math.pow(2,b))
def find(k,i,m,n):
    while k>0:
        if k+int(m)>=int(n):
            k=int(n)
        else:
            k=k+int(m)
        k=k-i
        i+=1
    return i-1
#实际上，如果m>n，那在i=m的下一天谷仓就空了
if int(m)>=int(n):
    print(int(m)+1)
else:
    i=i+int(math.pow(2,b))
    while int(m)>i:
        i+=1
    if int(m)<=i:
        a=find(k,i,m,n)
        if a==1:
            print(1)
        else:
            print(a)
  	 				 	   	   	 	   	