#include <stdio.h>
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
typedef long long Int;
int main() {
    Int n, k;
    scanf("%lld %lld", &n, &k);
    if (k == 0) {
        printf("%lld\n", n * n);
        return 0;
    }
    Int ans = 0;
    for (Int b = k + 1; b <= n; b++) {
        Int q = n / b;
        Int r = n % b;
        Int c = 0;
        if (q >= 1) {
            c += (q - 1) * k + (k - 1);
        }
        c += MIN(r, k - 1) + 1;
        ans += n - c;
    }
    printf("%lld\n", ans);
}

; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_581/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_581/source.m"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1

; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
  %n = alloca i64, align 8
  %k = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
  %0 = load i64, ptr %k, align 8
  %cmp = icmp eq i64 %0, 0
  %1 = load i64, ptr %n, align 8, !tbaa !5
  br i1 %cmp, label %if.then, label %for.cond.preheader

for.cond.preheader:                               ; preds = %entry
  %cmp2.not.not29 = icmp slt i64 %0, %1
  br i1 %cmp2.not.not29, label %for.body.lr.ph, label %cleanup

for.body.lr.ph:                                   ; preds = %for.cond.preheader
  %sub10 = add nsw i64 %0, -1
  br label %for.body

if.then:                                          ; preds = %entry
  %mul = mul nsw i64 %1, %1
  br label %cleanup

for.body:                                         ; preds = %for.body.lr.ph, %for.body
  %b.031.in = phi i64 [ %0, %for.body.lr.ph ], [ %b.031, %for.body ]
  %ans.030 = phi i64 [ 0, %for.body.lr.ph ], [ %add16, %for.body ]
  %b.031 = add nsw i64 %b.031.in, 1
  %div = sdiv i64 %1, %b.031
  %rem = srem i64 %1, %b.031
  %cmp3 = icmp sgt i64 %div, 0
  %2 = mul i64 %div, %0
  %add7.neg = sub i64 1, %2
  %c.0.neg32 = select i1 %cmp3, i64 %add7.neg, i64 0
  %cond = call i64 @llvm.smin.i64(i64 %rem, i64 %sub10)
  %add13.neg = add i64 %ans.030, -1
  %add14.neg = add i64 %add13.neg, %1
  %sub15 = sub i64 %add14.neg, %cond
  %add16 = add i64 %sub15, %c.0.neg32
  %exitcond.not = icmp eq i64 %b.031, %1
  br i1 %exitcond.not, label %cleanup, label %for.body

cleanup:                                          ; preds = %for.body, %for.cond.preheader, %if.then
  %ans.0.lcssa.sink = phi i64 [ %mul, %if.then ], [ 0, %for.cond.preheader ], [ %add16, %for.body ]
  %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa.sink)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3

attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
