using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yuki_407 { class Program { static void Main(string[] args) { var k = new List(); long ans = 0; int max = 10000000 / 2; var z = new int[max]; k.Add(2); for (int i = 3; i < max;i+=2) { bool t = true; for (int j = 3; j*j <=i; j++) { if (i%j==0) { t = false; break; } } if (t) { k.Add(i); } } var a = scan(); foreach (var i in k) { if (i*(a[0]-1)>a[1]) { break; } else { int m = i * (a[0] - 1); ans += a[1] - m + 1; } } Console.WriteLine(ans); } static int[] scan() { return Array.ConvertAll (Console.ReadLine().Split(' '), int.Parse); } } }