source_code: import java.util.*;
  import java.io.*;
  public class template {
  	public static void main(String[] args) {
  		FastScanner sc = new FastScanner();
  		PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
  		int n = sc.nextInt();
  		int k = sc.nextInt();
  		long left = 0;
  		long right = n;
  		long mid = left+right/2;
  		while(left<=right) {
  			mid = (left+(right))/2;
  			if(((mid+1)*mid)/2-(n-mid)==k) {
  				pw.println(n-mid);
  				pw.close();
  				break;
  			}
  			else if(((mid+1)*mid)/2-(n-mid)>k) {
  				right = mid-1;
  			}
  			else left = mid+1;
  		}
  	}
  }
  @SuppressWarnings("all")
  class FastScanner {
      BufferedReader br;
      StringTokenizer st;
  
      public FastScanner(String s) {
          try {
              br = new BufferedReader(new FileReader(s));
          } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  
      public FastScanner() {
          br = new BufferedReader(new InputStreamReader(System.in));
      }
  
      String nextToken() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
  
      int nextInt() {
          return Integer.parseInt(nextToken());
      }
  
      long nextLong() {
          return Long.parseLong(nextToken());
      }
  
      double nextDouble() {
          return Double.parseDouble(nextToken());
      }
  }