#include<bits/stdc++.h>
#define int long long
using namespace std;
bool used[1000005], vis[1000005];
int cnt[1000005];
long long poww(int a, int b){
long long ans = 1;
for(int i = 1; i <= b; i++){
ans *= a;
}
return ans;
}
signed main(){
int sum = 0, ans = 1;
int n, m;
cin >> n >> m;
for(int i = 1; i <= 20; i++){
for(int j = 1; j <= m; j++){
if(used[i * j] == false){
sum++;
used[i * j] = true;
}
}
cnt[i] = sum;
}
for(int i = 2; i <= n; i++){
int cntt = 0;
if(vis[i] == false){
for(int j = 1; poww(i, j) <= n; j++){
cntt++;
vis[poww(i, j)] = true;
}
ans += cnt[cntt];
}
}
cout << ans;
return 0;
}