//
// Written by Fyodor Menshikov 06.03.2010
// 08:02-08:06
//

import java.io.*;
import java.util.*;

class Main2 {

   Scanner in;
   PrintWriter out;

   void solve() {
      int first = in.nextInt();
      int last = in.nextInt();
      if (first == 0) {
         out.println((int)Math.sqrt(last) + 1);
      } else {
         out.println((int)Math.sqrt(last) - (int)Math.sqrt(first - 1));
      }
   }

   void run() {
      try {
         in = new Scanner(new InputStreamReader(System.in));
         out = new PrintWriter(new OutputStreamWriter(System.out));
      } catch (Exception e) {
         throw new Error(e);
      }
      try {
         solve();
      } finally {
         out.close();
      }
   }

   public static void main(String args[]) {
      new Main2().run();
   }
}
