using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (l, r) = (c[0], c[1]); var sq = new bool[r - l + 1]; for (var x = 2L; x <= 1_000_000; ++x) { var begin = (x * x - l) % (x * x); if (begin < 0) begin += x * x; for (var i = begin; i < sq.Length; i += x * x) sq[i] = true; } for (var k = 1L; k < 1_000_000; ++k) { var x = Sqrt(r / k); if (x <= 1_000_000) break; if (l <= k * x * x && k * x * x <= r) sq[k * x * x - l] = true; } WriteLine(sq.Count(f => !f)); } static long Sqrt(long n) { var ans = (long)Math.Sqrt(n); if ((ans + 1) * (ans + 1) <= n) return ans + 1; return ans; } }