import java.util.*;
import java.io.*;
import java.math.*;
import java.math.BigInteger;
import java.text.DecimalFormat;
class Tester {
//static long sum=0,sum1=Long.MAX_VALUE;
//DecimalFormat df = new DecimalFormat("#.#####");
static int visited[] = new int[100005];
//Stack s=new Stack();
//static int count=0;
public static final long MOD = (long) (1e9 + 7);
static long h[];
static long j;
// Driver program to test above function
public static void main
(String args
[]) {
Scanner sc
=new Scanner
(System.
in); InputReader in
= new InputReader
(System.
in); /*....................Code starts Here..............................*/
long n=in.nextLong();
long m=in.nextLong();
if(n<=m)
{
out.println(n);
}
else
{
long ans=0;
long low=m+1;
long high=n;
long ans1=0;
while(low<=high)
{
// out.println(low+" "+high);
long mid=(low+high)/2;
long e=mid-m-1;
double sum=(double)((double)(e)*(double)(e+1))/2;
{
long ini=(long)(n-sum-mid);
if(ini<=0)
{
ans=mid;
high=mid-1;
}
else
{
low=mid+1;
}
}
}
out.println(ans);
}
out.close();
/*.......................Code ends Here................................*/
}
static class InputReader {
tokenizer = null;
}
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
fullLine=reader.readLine();
}
return fullLine;
}
return fullLine;
}
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
}
}
return tokenizer.nextToken();
}
public long nextLong() {
return Long.
parseLong(next
()); }
public int nextInt() {
}
{
return Double.
parseDouble(next
()); }
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5pby4qOwppbXBvcnQgamF2YS5tYXRoLio7CmltcG9ydCBqYXZhLm1hdGguQmlnSW50ZWdlcjsKaW1wb3J0IGphdmEudGV4dC5EZWNpbWFsRm9ybWF0OwogICAgY2xhc3MgVGVzdGVyIHsKCS8vc3RhdGljIGxvbmcgc3VtPTAsc3VtMT1Mb25nLk1BWF9WQUxVRTsKCS8vRGVjaW1hbEZvcm1hdCBkZiA9IG5ldyBEZWNpbWFsRm9ybWF0KCIjLiMjIyMjIik7CgkJc3RhdGljIGludCB2aXNpdGVkW10gPSBuZXcgaW50WzE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