//
// Written by Fyodor Menshikov 06.03.2010
// 07:52-08:02
//

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

class Assert {
   static void check(boolean e) {
      if (!e) {
         throw new Error();
      }
   }
}

class Main {

   Scanner in;
   PrintWriter out;

   void solve() {
      int first = in.nextInt();
      int last = in.nextInt();
      Assert.check(0 <= first);
      Assert.check(first <= last);
      Assert.check(last <= 1000000000);
      int firstSqrt = (int)Math.ceil(Math.sqrt(first));
      Assert.check(firstSqrt * firstSqrt >= first);
      Assert.check(firstSqrt == 0 || firstSqrt > 0 && (firstSqrt - 1) * (firstSqrt - 1) < first);
      int lastSqrt = (int)Math.floor(Math.sqrt(last));
      Assert.check(lastSqrt * lastSqrt <= last);
      Assert.check(lastSqrt >= 0 && (lastSqrt + 1) * (lastSqrt + 1) > last);
      out.println(lastSqrt - firstSqrt + 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 Main().run();
   }
}
