#include using namespace std; using ll = long long; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int n, m; cin >> n >> m; vector ans(n + 1), dp(n + 1); for (int i = 1; i <= n; i++) ans[i] = ans[i - 1] + m; vector> divs(n + 1); for (int x = 1; x <= n; x++) { for (int y = x; y <= n; y += x) { divs[y].push_back(x); } } for (ll x = 1; x <= n; x++) { dp[x] += dp[x - 1]; for (int y : divs[x]) { dp[x] -= (x - 1) / y * y; dp[x] += x / y * y; } } ll ANS = 0; for (int i = 1; i <= n; i++) ANS = max(ANS, ans[i] - dp[i]); cout << ANS << "\n"; }