import std.stdio, std.algorithm, std.string, std.conv, std.array, std.range, std.math, core.stdc.stdio;
int readint() { return readln.chomp.to!int; }
int[] readints() { return readln.split.to!(int[]); }

int calc(int n, int k, int b) {
    int cnt = max(0, b - k);
    int p = n / b;
    int r = n % b;
    int x = max(0, r - k + 1);
    return p * cnt + x;
}

void main() {
    auto input = readints();
    int n = input[0], k = input[1];

    int ans;
    foreach (b; 1..n+1)
        ans += calc(n, k, b);
    if (k == 0) ans -= n;
    ans.writeln;

    auto _ = readln(); // dbg
}