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);
		  	  	OutputStream outputStream = System.out;
		  	  	PrintWriter out = new PrintWriter(outputStream);
		  	  	/*....................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 {
				public BufferedReader reader;
				public StringTokenizer tokenizer;
		 
				public InputReader(InputStream inputstream) {
					reader = new BufferedReader(new InputStreamReader(inputstream));
					tokenizer = null;
				}
		 
				public String nextLine(){
					String fullLine=null;
					while (tokenizer == null || !tokenizer.hasMoreTokens()) {
						try {
							fullLine=reader.readLine();
						} catch (IOException e) {
							throw new RuntimeException(e);
						}
						return fullLine;
					}
					return fullLine;
				}
				public String next() {
					while (tokenizer == null || !tokenizer.hasMoreTokens()) {
						try {
							tokenizer = new StringTokenizer(reader.readLine());
						} catch (IOException e) {
							throw new RuntimeException(e);
						}
					}
					return tokenizer.nextToken();
				}
				public long nextLong() {
					return Long.parseLong(next());
				}
				public int nextInt() {
					return Integer.parseInt(next());
				}
				public Double nextDouble()
				{
					return Double.parseDouble(next());
				}
			}
		}
