#include using namespace std; //xの約数の総和を求める //O(√N) long long f(int x, int M) { long long ret = 0; for (int d = 1; d * d <= x; d++) { if (x%d) continue; if (d <= M) ret += d; if (x != d * d && x/d <= M) ret += x/d; } return ret; } int main() { //O(N√N)解法 int N, M; cin >> N >> M; vector S(N+1); S[0] = 0; //S[i] = S[i-1] + Plus[i] vector Plus(N+1, M); for (int i = 1; i <= N; i++) { Plus[i] -= f(i, M); } for (int i = 1; i <= N; i++) S[i] = S[i-1] + Plus[i]; long long ans = 0; for (int i = 1; i <= N; i++) ans = max(ans, S[i]); cout << ans << endl; }