using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static int N,L; static Scanner sc = new Scanner(); static int[] Primes; static void Main() { N = sc.NextInt(); L = sc.NextInt(); int[] Primes = PrimeCalc(5000000); long ans = 0; for(int i = 0; i < Primes.Length; i++) { int q = Primes[i] * (N - 1); if (L>=q) { ans += (L - q + 1); } else { break; } } Console.WriteLine(ans); } static int[] PrimeCalc(int max) { int loop = (int)Math.Sqrt(max); bool[] num = new bool[max + 1]; num[0] = true; num[1] = true; for(int i = 2 * 2; i <= max; i += 2) { num[i] = true; } for(int i = 3; i <= loop; i += 2) { if (!num[i]) { for(int j = i + i; j <= max; j += i) { num[j] = true; } } } List res = new List(); res.Add(2); for(int i = 3; i <= max; i += 2) { if (!num[i]) { res.Add(i); } } return res.ToArray(); } } public class Scanner { private string[] S; private int Index; private char Separator; public Scanner(char separator=' ') { Index = 0; Separator = separator; } public string Next() { string result; if (S == null || Index >= S.Length) { S = Line(); Index = 0; } result = S[Index]; Index++; return result; } private string[] Line() { return Console.ReadLine().Split(Separator); } public int NextInt() { return int.Parse(Next()); } public double NextDouble() { return double.Parse(Next()); } public long NextLong() { return long.Parse(Next()); } }