#include #include #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace atcoder; using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; auto f = [&](int x) { if (!(1 <= x && x <= n)) return 0LL; ll ret = 0; rep(i, 1, m + 1) { ret += x % i; } return ret; }; ll ans = 0; rep(i, n - 300, n + 1) { ans = max(ans, f(i)); } // rep(i, 1, n + 1) { cerr << i << " " << f(i) << endl; } cout << ans << endl; }