source_code: import java.io.*;
  import java.util.*;
  
  public class A {
  
  	public static void main(String[] args) throws IOException {
  		Scanner sc = new Scanner();
  		PrintWriter out = new PrintWriter(System.out);
  		int n=sc.nextInt(),k=sc.nextInt();
  		for(int x=0;;x++) {
  			if(2*1L*x+x*1L*(x+1)==2L*(k+n)) {
  				out.println(n-x);
  				break;
  			}
  		}
  		out.close();
  
  	}
  
  	static class Scanner {
  		BufferedReader br;
  		StringTokenizer st;
  
  		Scanner() {
  			br = new BufferedReader(new InputStreamReader(System.in));
  		}
  
  		Scanner(String fileName) throws FileNotFoundException {
  			br = new BufferedReader(new FileReader(fileName));
  		}
  
  		String next() throws IOException {
  			while (st == null || !st.hasMoreTokens())
  				st = new StringTokenizer(br.readLine());
  			return st.nextToken();
  		}
  
  		String nextLine() throws IOException {
  			return br.readLine();
  		}
  
  		int nextInt() throws IOException {
  			return Integer.parseInt(next());
  		}
  
  		long nextLong() throws NumberFormatException, IOException {
  			return Long.parseLong(next());
  		}
  
  		double nextDouble() throws NumberFormatException, IOException {
  			return Double.parseDouble(next());
  		}
  
  		boolean ready() throws IOException {
  			return br.ready();
  		}
  
  	}
  
  }