source_code: import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.StringTokenizer;
  
  public class Main {
      static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      static StringTokenizer st = new StringTokenizer("");
      static PrintWriter pw = new PrintWriter(System.out);
  
      public static String next() throws IOException {
          while (!st.hasMoreTokens()) {
              st = new StringTokenizer(br.readLine());
          }
          return st.nextToken();
      }
  
      public static int nextInt() throws IOException {
          return Integer.parseInt(next());
      }
  
      public static long nextLong() throws IOException {
          return Long.parseLong(next());
      }
  
      public static void main(String[] args) throws IOException {
          new Main().run();
      }
  
      void run() throws IOException {
          long n = nextInt();
          long k = nextInt();
          long d = 9 + 8 * (n + k);
          pw.print(n - (-3 + (int)Math.sqrt(d)) / 2);
          pw.close();
      }
  }