#include <iostream>
using namespace std;
long long n;
int p, num = 0, prime[26];
inline void init() {
static int mark[110];
for (int i = 2; i <= p; i++) {
if (!mark[i]) {
prime[num++] = i;
}
for (int j = 0, t = 2; j < num
&& i * t <= p; t = prime[++j]) {
mark[i * t] = 1;
if (i % t == 0) {
break;
}
}
}
}
unsigned int ans = 0;
void dfs(long long n, int p) {
if (!p) {
cout << n << '\n';
ans += __lg(n) + 1;
return;
}
dfs(n, p - 1);
if (n >= prime[p]) {
dfs(n / prime[p], p);
}
}
int main() {
cin >> n >> p;
init(), dfs(n, num - 1);
cout << ans << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpsb25nIGxvbmcgbjsKaW50IHAsIG51bSA9IDAsIHByaW1lWzI2XTsKaW5saW5lIHZvaWQgaW5pdCgpIHsKICAgIHN0YXRpYyBpbnQgbWFya1sxMTBdOwoKICAgIGZvciAoaW50IGkgPSAyOyBpIDw9IHA7IGkrKykgewogICAgICAgIGlmICghbWFya1tpXSkgewogICAgICAgICAgICBwcmltZVtudW0rK10gPSBpOwogICAgICAgIH0KCiAgICAgICAgZm9yIChpbnQgaiA9IDAsIHQgPSAyOyBqIDwgbnVtCiAgICAgICAgICAgICAgICAmJiBpICogdCA8PSBwOyB0ID0gcHJpbWVbKytqXSkgewogICAgICAgICAgICBtYXJrW2kgKiB0XSA9IDE7CgogICAgICAgICAgICBpZiAoaSAlIHQgPT0gMCkgewogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0KdW5zaWduZWQgaW50IGFucyA9IDA7CnZvaWQgZGZzKGxvbmcgbG9uZyBuLCBpbnQgcCkgewogICAgaWYgKCFwKSB7CiAgICAJY291dCA8PCBuIDw8ICdcbic7CiAgICAgICAgYW5zICs9IF9fbGcobikgKyAxOwogICAgICAgIHJldHVybjsKICAgIH0KCiAgICBkZnMobiwgcCAtIDEpOwoKICAgIGlmIChuID49IHByaW1lW3BdKSB7CiAgICAgICAgZGZzKG4gLyBwcmltZVtwXSwgcCk7CiAgICB9Cn0KaW50IG1haW4oKSB7CiAgICBjaW4gPj4gbiA+PiBwOwogICAgaW5pdCgpLCBkZnMobiwgbnVtIC0gMSk7CiAgICBjb3V0IDw8IGFucyA8PCBlbmRsOwogICAgcmV0dXJuIDA7Cn0K