using System.Xml;
using System.ComponentModel.Design;
using System.Security.AccessControl;
using System.Globalization;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;

namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = Console.ReadLine().Split(' ');
            var rows = Int32.Parse(arr[0]);
            var cols = Int32.Parse(arr[1]);
            Console.WriteLine(GetCount(rows,cols));

        }

        private static long GetCount(int rows, int cols)
        {
            if(rows == 1)
            {
                return 1;
            }
            var res = 1L;
            var maxPows = new int[rows+1];
            var cntArr = GetCntArr(cols);
            for(var i = 2;i <= rows;i++)
            {
                var tmp = i;
                for(var j=2;j<rows;j++)
                {
                    if(tmp<= rows/i)
                    {
                        tmp*=i;
                        if(maxPows[tmp] == 0)
                            maxPows[tmp] = j;
                    }
                    else
                    {
                        break;
                    }
                }

                if(maxPows[i] == 0)
                {
                    res+= cols;
                }
                else
                {
                    res+= cntArr[maxPows[i]];
                }

            }
            return res;
        }

        private static int[] GetCntArr(int n)
        {
            var cntArr = new int[21];

            for(var i =2;i<=20;i++)
            {
                var usedArr = new bool[n+1];
                for(var j = 1;j < i;j++)
                {
                    for(var k=1;k<=n;k++)
                    {
                        if(j*k % i == 0)
                        {
                            usedArr[j*k / i] = true;
                        }
                    }
                }
                for(var k=1;k<=n;k++)
                {
                    if(!usedArr[k]) cntArr[i]++;
                }
            }

            return cntArr;

        }

        private static int GetGCD(int num0, int num1)
        {
            if(num0 < num1)
            {
                var tmp = num0;
                num0 = num1;
                num1 = tmp;
            }
            while(num1!=0)
            {
                var tmp = num0% num1;
                num0 = num1;
                num1 = tmp;
            }
            return num0;
        }

        private static int BruteGetCount(int rows, int cols)
        {
            var set = new HashSet<int>();
            for(var i =1;i<=rows;i++)
            {
                var tmp = 1;
                for(var j=1;j<=cols;j++)
                {
                    tmp*=i;
                    set.Add(tmp);
                }
            }
            return set.Count;
        }

    }
}

// Online C# Editor for free
// Write, Edit and Run your C# code using C# Online Compiler

using System;

public class HelloWorld
{
    public static void Main(string[] args)
    {
        var arr = Console.ReadLine().Split(' ');

        int rows = Int32.Parse(arr[0]);
        int columns = Int32.Parse(arr[1]);
        //Console.WriteLine(rows);
       // Console.WriteLine(columns);
       Console.WriteLine(getUniqueNumbers(rows,columns));
    }

    public static int[] precalculate(int m){
        var cnt = new int[21];
        var vis = new bool[20000002];
        int c=0;
        for(int i=1;i<=20;++i){
            for(int j=1;j<=m;++j){
                if(!vis[i*j]){
                    vis[i*j]=true;
                    ++c;
                }
            }
            cnt[i]=c;
        }

        return cnt;
    }

    public static long getUniqueNumbers(int rows, int columns){
        var arr = precalculate(columns);

        long res=1;
        var vis = new bool[20000002];

        for(int i=2;i<=rows;++i){
            if(vis[i])continue;
            long j=i;
            int c=0;

            while(j<=(long)rows){
                vis[j]=true;
                j*=i;
                ++c;
            }

            res+= arr[c];
        }

        return res;
    }

}

using System.Xml;
using System.ComponentModel.Design;
using System.Security.AccessControl;
using System.Globalization;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;

namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = Console.ReadLine().Split(' ');
            var rows = Int32.Parse(arr[0]);
            var cols = Int32.Parse(arr[1]);
            Console.WriteLine(GetCount(rows,cols));
        }

        private static long GetCount(int rows, int cols)
        {
            if(rows == 1)
            {
                return 1;
            }
            var res = 1L;
            var maxPows = new int[rows+1];
            var cntArr = GetCntArr(cols);
            for(var i = 2;i <= rows;i++)
            {
                var tmp = i;
                for(var j=2;j<rows;j++)
                {
                    if(tmp<= rows/i)
                    {
                        tmp*=i;
                        if(maxPows[tmp] == 0)
                            maxPows[tmp] = j;
                    }
                    else
                    {
                        break;
                    }
                }

                if(maxPows[i] == 0)
                {
                    res+= cols;
                }
                else
                {
                    res+= cntArr[maxPows[i]];
                }

            }
            return res;
        }

        private static int[] GetCntArr(int n)
        {
            var cntArr = new int[21];

            for(var i =2;i<=20;i++)
            {
                var usedArr = new bool[n+1];
                for(var j = 1;j < i;j++)
                {
                    var gcd = GetGCD(i,j);
                    var tmp = i/gcd;
                    for(var k=1;k<=n/tmp;k++)
                    {
                        usedArr[k * j/gcd] = true;
                    }
                }
                for(var k=1;k<=n;k++)
                {
                    if(!usedArr[k]) cntArr[i]++;
                }
            }

            return cntArr;

        }

        private static int GetGCD(int num0, int num1)
        {
            if(num0 < num1)
            {
                var tmp = num0;
                num0 = num1;
                num1 = tmp;
            }
            while(num1!=0)
            {
                var tmp = num0% num1;
                num0 = num1;
                num1 = tmp;
            }
            return num0;
        }

        private static int BruteGetCount(int rows, int cols)
        {
            var set = new HashSet<int>();
            for(var i =1;i<=rows;i++)
            {
                var tmp = 1;
                for(var j=1;j<=cols;j++)
                {
                    tmp*=i;
                    set.Add(tmp);
                }
            }
            return set.Count;
        }

    }
}

using System.Xml;
using System.ComponentModel.Design;
using System.Security.AccessControl;
using System.Globalization;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;

namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = Console.ReadLine().Split(' ');
            var rows = Int32.Parse(arr[0]);
            var cols = Int32.Parse(arr[1]);
            Console.WriteLine(GetCount(rows,cols));
        }

        private static long GetCount(int rows, int cols)
        {
            if(rows == 1)
            {
                return 1;
            }
            var res = 1L;
            var maxPows = new int[rows+1];
            var cntArr = GetCntArr(cols);
            for(var i = 2;i <= rows;i++)
            {
                var tmp = i;
                for(var j=2;j<rows;j++)
                {
                    if(tmp<= rows/i)
                    {
                        tmp*=i;
                        if(maxPows[tmp] == 0)
                            maxPows[tmp] = j;
                    }
                    else
                    {
                        break;
                    }
                }

                if(maxPows[i] == 0)
                {
                    res+= cols;
                }
                else
                {
                    res+= cntArr[maxPows[i]];
                }

            }
            return res;
        }

        private static int[] GetCntArr(int n)
        {
            var cntArr = new int[21];

            for(var i =2;i<=20;i++)
            {
                var usedArr = new bool[n+1];
                for(var j = 1;j < i;j++)
                {
                    var gcd = GetGCD(i,j);
                    var tmp = i/gcd;
                    for(var k=1;k<=n/tmp;k++)
                    {
                        usedArr[tmp*k / i] = true;
                    }
                }
                for(var k=1;k<=n;k++)
                {
                    if(!usedArr[k]) cntArr[i]++;
                }
            }

            return cntArr;

        }

        private static int GetGCD(int num0, int num1)
        {
            if(num0 < num1)
            {
                var tmp = num0;
                num0 = num1;
                num1 = tmp;
            }
            while(num1!=0)
            {
                var tmp = num0% num1;
                num0 = num1;
                num1 = tmp;
            }
            return num0;
        }

        private static int BruteGetCount(int rows, int cols)
        {
            var set = new HashSet<int>();
            for(var i =1;i<=rows;i++)
            {
                var tmp = 1;
                for(var j=1;j<=cols;j++)
                {
                    tmp*=i;
                    set.Add(tmp);
                }
            }
            return set.Count;
        }

    }
}

using System.Xml;
using System.ComponentModel.Design;
using System.Security.AccessControl;
using System.Globalization;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;

namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = Console.ReadLine().Split(' ');
            var rows = Int32.Parse(arr[0]);
            var cols = Int32.Parse(arr[1]);
            Console.WriteLine(GetCount(rows,cols));
        }

        private static long GetCount(int rows, int cols)
        {
            if(rows == 1)
            {
                return 1;
            }
            var res = 1L;
            var maxPows = new int[rows+1];
            var cntArr = GetCntArr(cols);
            for(var i = 2;i <= rows;i++)
            {
                var tmp = i;
                for(var j=2;j<rows;j++)
                {
                    if(tmp<= rows/i)
                    {
                        tmp*=i;
                        if(maxPows[tmp] == 0)
                            maxPows[tmp] = j;
                    }
                    else
                    {
                        break;
                    }
                }

                if(maxPows[i] == 0)
                {
                    res+= cols;
                }
                else
                {
                    res+= cntArr[maxPows[i]];
                }

            }
            return res;
        }

        private static int[] GetCntArr(int n)
        {
            var cntArr = new int[21];

            for(var i =2;i<=20;i++)
            {
                var usedArr = new bool[n+1];
                for(var j = 1;j < i;j++)
                {
                    var gcd = GetGCD(i,j);
                    var tmp = j/gcd;
                    for(var k=1;k<=n/tmp;k++)
                    {
                        usedArr[tmp*k / i] = true;
                    }
                }
                for(var k=1;k<=n;k++)
                {
                    if(!usedArr[k]) cntArr[i]++;
                }
            }

            return cntArr;

        }

        private static int GetGCD(int num0, int num1)
        {
            if(num0 < num1)
            {
                var tmp = num0;
                num0 = num1;
                num1 = tmp;
            }
            while(num1!=0)
            {
                var tmp = num0% num1;
                num0 = num1;
                num1 = tmp;
            }
            return num0;
        }

        private static int BruteGetCount(int rows, int cols)
        {
            var set = new HashSet<int>();
            for(var i =1;i<=rows;i++)
            {
                var tmp = 1;
                for(var j=1;j<=cols;j++)
                {
                    tmp*=i;
                    set.Add(tmp);
                }
            }
            return set.Count;
        }

    }
}