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 a = scan(); int max = a[1]/(a[0]-1); var k = Enumerable.Range(2, max).ToList(); eratos(k, max); long ans = 0; foreach (var i in k) { //Console.WriteLine(i); int m = a[1] - i*(a[0]-1) + 1; if (m<0) { break; } else { ans += m; } } Console.WriteLine(ans); } static void eratos(List p,int n) { for (int i = 0; i < p.Count; i++) { int t = p[i]; for (int j = t+t; j <= n; j+=t) { p.Remove(t); } } } static int[] scan() { return Array.ConvertAll (Console.ReadLine().Split(' '), int.Parse); } } }