CodeEff/ECCO huggingface dataset:
# Original solution
from sys import stdin

A, B, M = [int(x) for x in stdin.readline().rstrip().split()]
a = [int(x) for x in stdin.readline().rstrip().split()]
b = [int(x) for x in stdin.readline().rstrip().split()]
X = [[int(x) for x in stdin.readline().rstrip().split()] for _ in range(M)]

L = []
for a_i in a:
    for b_i in b:
        L.append(a_i + b_i)

for x in X:
    L.append(a[x[0]-1] + b[x[1]-1] - x[2])
    
print((min(L)))


# Optimized solution
from sys import stdin

A, B, M = [int(x) for x in stdin.readline().rstrip().split()]
a = [int(x) for x in stdin.readline().rstrip().split()]
b = [int(x) for x in stdin.readline().rstrip().split()]
X = [[int(x) for x in stdin.readline().rstrip().split()] for _ in range(M)]

L = []
L.append(min(a) + min(b))

for x in X:
    L.append(a[x[0]-1] + b[x[1]-1] - x[2])
    
    
print((min(L)))
# Original solution
a,b,m = list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = [tuple(map(int,input().split())) for i in range(m)]
p = []
x = 0
p.append(min(a)+min(b))
for ka,ai in enumerate(a):
    for kb,bi in enumerate(b):
        for t in c:
            if t[0]==ka+1 and t[1]==kb+1:
                x = t[2]
                p.append(ai+bi-x)
print((min(p)))

# Optimized solution
a,b,m = list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = [tuple(map(int,input().split())) for i in range(m)]
p = min(a)+min(b)
for t in c:
    p = min(p,a[t[0]-1]+b[t[1]-1]-t[2])
print(p)
# Original solution
a,b,m = list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = [tuple(map(int,input().split())) for i in range(m)]
p = min(a)+min(b)
for t in c:
    p = min(p,a[t[0]-1]+b[t[1]-1]-t[2])
print(p)

# Optimized solution
a,b,m = list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = [tuple(map(int,input().split())) for i in range(m)]
p = [min(a)+min(b)]
for t in c:
    p.append(a[t[0]-1]+b[t[1]-1]-t[2])
print((min(p)))
# Original solution
a, b, m = list(map(int, input().split()))
priceOfMicrowaves = list(map(int, input().split()))
priceOfRefrigerators = list(map(int, input().split()))
priceTable = [list(map(int,input().split())) for i in range(m)]
cheepest = priceOfMicrowaves[0] + priceOfRefrigerators[0]
for price in priceTable:
    if priceOfMicrowaves[price[0]-1]-price[2] >= cheepest:
        continue
    elif priceOfRefrigerators[price[1]-1]-price[2] >= cheepest:
        continue
    elif priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2] < cheepest:
        cheepest = priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2]
for p in priceOfMicrowaves:
    if p >= cheepest:
        continue
    for q in priceOfRefrigerators:
        if q >= cheepest:
            continue
        if p + q < cheepest:
            cheepest = p + q
print(cheepest)

# Optimized solution
a, b, m = list(map(int, input().split()))
priceOfMicrowaves = list(map(int, input().split()))
priceOfRefrigerators = list(map(int, input().split()))
priceTable = [list(map(int,input().split())) for i in range(m)]
cheepest = priceOfMicrowaves[0] + priceOfRefrigerators[0]
for price in priceTable:
    if priceOfMicrowaves[price[0]-1]-price[2] >= cheepest:
        continue
    elif priceOfRefrigerators[price[1]-1]-price[2] >= cheepest:
        continue
    elif priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2] < cheepest:
        cheepest = priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2]
if cheepest > min(priceOfMicrowaves) + min(priceOfRefrigerators):
    cheepest = min(priceOfMicrowaves) + min(priceOfRefrigerators)
print(cheepest)
# Original solution
S = input().split()

#冷蔵庫
A = int(S[0])
#電子レンジ
B = int(S[1])
#割引券
M = int(S[2])



a = list(map(int,input().split()))
b = list(map(int,input().split()))

total_mini = 999999999
for j in range(A):
    for k in range(B):
        total = a[j] + b[k]
        if total_mini > total:
            total_mini = total



minimum = 999999999
for i in range(M):
    m = list(map(int,input().split()))
    amount = a[m[0]-1] + b[m[1]-1] - m[2]

    if minimum > amount:
        minimum = amount


if minimum <= total_mini:
    print(minimum)
else:
    print(total_mini)


# Optimized solution
S = input().split()

#冷蔵庫
A = int(S[0])
#電子レンジ
B = int(S[1])
#割引券
M = int(S[2])



a = list(map(int,input().split()))
b = list(map(int,input().split()))
total_mini = min(a) + min(b)


for i in range(M):
    m = list(map(int,input().split()))
    amount = a[m[0]-1] + b[m[1]-1] - m[2]

    if total_mini > amount:
        total_mini = amount


print(total_mini)
# Original solution
def resolve():
    A, B, M = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    grid=[list(map(int,input().split())) for i in range(M)]

    res = min(a) + min(b)
    for m in grid:
        if m[0]-1 < A and m[1]-1 < B:
            tmp = a[m[0]-1] + b[m[1]-1] - m[2]
        
            if tmp < res:
                res = tmp

    print(res)
    
resolve()

# Optimized solution
def resolve():
    A, B, M = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    grid=[list(map(int,input().split())) for i in range(M)]

    res = min(a) + min(b)

    for x, y, c in grid:
        res = min(res, a[x-1]+b[y-1]-c)

    print(res)
    
resolve()
# Original solution
import sys

def main():
    input = sys.stdin.readline

    a, b, m = input().split()
    a, b, m = int(a), int(b), int(m)
    alist = input().split()
    blist = input().split()

    waribiki = [input().split() for _ in range(m)]
    
    res = [200000] * 200001
    count = 0
    for i in range(a):
      for j in range(b):
        try:
            res[count] = int(alist[i]) + int(blist[j])
        except Exception:
            pass
        count += 1

    for i in range(m):
        res[count] = int(alist[int(waribiki[i][0])-1]) + int(blist[int(waribiki[i][1])-1]) - int(waribiki[i][2])
        count += 1
      
    print((min(res)))


if __name__ == '__main__':
    main()

# Optimized solution
import sys

def main():
    input = sys.stdin.readline

    a, b, m = input().split()
    a, b, m = int(a), int(b), int(m)
    alist = list(map(int, input().split()))
    blist = list(map(int, input().split()))

    waribiki = [input().split() for _ in range(m)]
    
    res = [200000] * (m + 1)
    count = 0

    for i in range(m):
        res[count] = alist[int(waribiki[i][0])-1] + blist[int(waribiki[i][1])-1] - int(waribiki[i][2])
        count += 1

    res[count] = min(alist) + min(blist)
      
    print((min(res)))


if __name__ == '__main__':
    main()
# Original solution
A, B, M = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 10**6

for i in range(M):
    x, y, c = list(map(int, input().split()))
    ans = min(ans, a[x - 1] + b[y - 1] - c)

ans = min(ans, min(a) + min(b))

print(ans)

# Optimized solution
import sys
input = sys.stdin.readline

def main():
    A, B, M = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    ans = 10**6

    for i in range(M):
        x, y, c = list(map(int, input().split()))
        ans = min(ans, a[x - 1] + b[y - 1] - c)

    ans = min(ans, min(a) + min(b))

    print(ans)

main()
# Original solution
A, B, M = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 10**6
for i in range(M):
    X, Y, C = list(map(int, input().split()))
    if(ans > a[X-1]+b[Y-1]-C):
        ans = a[X-1]+b[Y-1]-C

for j in range(len(a)):
    for k in range(len(b)):
        if(a[j]+b[k] < ans):
            ans = a[j]+b[k]
print(ans)

# Optimized solution
A, B, M = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = min(a)+min(b)
for i in range(M):
    X, Y, C = list(map(int, input().split()))
    if(ans > a[X-1]+b[Y-1]-C):
        ans = a[X-1]+b[Y-1]-C

print(ans)
# Original solution
n = int(eval(input()))
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):
    a = P[i][0] ; b = P[i][1]; c = P[i+1][0] ; d = P[i+1][1]
    s += a * d - b * c
print((abs(s)*0.5))

# Optimized solution
n = int(eval(input()))
P =[]
s = 0
x0,y0 = [int(i) for i in input().split()]
for i in range(n-1):
    x,y = [int(i) for i in input().split()]
    P.append([x-x0,y-y0])
for i in range(n-2):
    s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print((abs(s)*0.5))
# Original solution
n = int(eval(input()))
P =[]
s = 0
for i in range(n):P.append(input().split())
P.append(P[0])
for i in range(n):s += int(P[i][0])*int(P[i+1][1]) - int(P[i][1])*int(P[i+1][0])
print((abs(s)*0.5))

# Optimized solution
n = int(eval(input()))
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += (P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0])
print((abs(s)*0.5))
# Original solution
def area(p,q):return p[0]*q[1]-p[1]*q[0]
 
n=int(eval(input()))
point=[]
x_1,y_1=[int(i) for i in input().split(" ")]
 
for _ in range(n-1):
    x,y=[int(i) for i in input().split(" ")]
    point.append([x-x_1,y-y_1])
a=0
for i in range(n-2):a+=area(point[i],point[i+1])
print((a*0.5))

# Optimized solution
n=int(eval(input()))
point=[]
x_1,y_1=[int(i) for i in input().split(" ")]
 
for _ in range(n-1):
    x,y=[int(i) for i in input().split(" ")]
    point.append([x-x_1,y-y_1])
a=0
for i in range(n-2):a+=point[i][0]*point[i+1][1] - point[i][1]*point[i+1][0]
print((a*0.5))
# Original solution
x=list(range(int(eval(input()))))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print((_*0.5))

# Optimized solution
x=list(range(int(eval(input()))))
P=[]
Q=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:Q+=[P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]]
print((sum(Q)*0.5))
# Original solution
x=list(range(int(eval(input()))))
P=[]
Q=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:Q+=[P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]]
print((sum(Q)*0.5))

# Optimized solution
x=list(range(int(eval(input()))))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j+1][0]*P[j][1]
print((_*0.5))
# Original solution
x=list(range(int(eval(input()))))
P=[]
for _ in reversed(x):P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print((_*0.5))

# Optimized solution
x=list(range(int(eval(input()))-1,-1,-1))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print((_*0.5))
# Original solution
N, K = list(map(int,input().split()))

if K > 0:
    count = 0

    for a in range(1, N+1):
        for b in range(K+1, a):
            if a%b >= K:
                count = count + 1
    
    count = count + int((N+1-K)*(N-K)/2)

    print(count)
else:
    print((N*N))

# Optimized solution
N, K = list(map(int,input().split()))

if K > 0:
    count = 0

    for b in range(K+1, N+1):
        p = N // b
        r = N % b
        count = count + p*(b-K)
        if r >= K:
            count = count + r-K+1
    
    print(count)
else:
    print((N*N))
# Original solution
#!/usr/bin/env python3
import sys


def solve(N: int, K: int):
    if K!=0:
        ans = 0
        for j in range(1,N+1): #10**5ループなのでいけるはず。
            if K <= j-1:
                ans += (j-K) * (N//j)
                if N%j >=K:
                    ans += N%j - K + 1
    else:
        ans = N * N

    print(ans)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys


def solve(N: int, K: int):
    if K!=0:
        ans = 0
        for j in range(K+1,N+1):      
            ans += (j-K) * (N//j)
            if N%j >=K:
                ans += N%j - K + 1
    else:
        ans = N * N

    print(ans)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()
# Original solution
n, k = list(map(int, input().split()))

if k == 0:
  print((n**2))
  exit()

ans  = 0

for b in range(1,n+1):

  # 連続部分
  if b - k > 0:
    ans += (n // b) * (b-k)
    
  # 繰り返し範囲外
  if ((n - (n // b)*b) - (k-1)) > 0:
    ans += ((n - (n // b)*b) - (k-1))


  
  
print(ans)

# Optimized solution
N,K = list(map(int, input().split()))

if K == 0:
    print((N*N))
    exit()


ans = 0
for b in range(K+1,N+1):
    # N = b * num + rest
    num = N // b 
    rest = N - (b*num)
    # b一周期の中に、余りがK以上になる数字が(b-K)個、残りの中でさらに余りがKを超える物があればそれも加算
    ans += (b - K) * num + max(0, rest-K+1) 


print(ans)
# Original solution
N,K = list(map(int,input().split()))
count = 0
if K == 0:
    print((N*N))
else:
    for b in range(K+1,N+1):
        x = N // b
        y = N % b
        count = count + (b-K)*x
        if y >= K:
            count = count + y-K+1
    print(count)

# Optimized solution
N,K = list(map(int,input().split()))
count = 0
if K == 0:
    print((N*N))
else:
    for b in range(K+1,N+1):
        x = N // b
        y = N % b
        count = count + (b-K)*x #植木算.b-1-K+1 = b-K
        if y >= K:
            count = count + y-K+1 #K=0のときはこの式だと1多くなってしまう
    print(count)
# Original solution
N, K = list(map(int, input().split()))

if K == 0:
    print((N**2))
    exit()

ans = 0
for b in range(1, N+1):
    p = N // b
    r = N % b
    ans += max(0, b-K) * p
    ans += max(0, r-K+1)

print(ans)

# Optimized solution
N, K = list(map(int, input().split()))
ans = 0
if K == 0:
    print((N ** 2))
else:
    for b in range(1, N+1):
        ans += (N // b) * max(0, b - K) + max(0, (N % b) - K + 1)
    print(ans)
# Original solution
N, K = list(map(int, input().split()))
ans = 0
for b in range(1, N + 1):
    ans += (N // b) * max(0, b - K) + max(0, (N % b) - K + 1)
print((ans - (N if K == 0 else 0)))


# Optimized solution
N, K = list(map(int, input().split()))

ans = 0
for b in range(K + 1, N + 1):
    ans += (b - K) * (N // b)
    ans += max(0, N % b - K + 1)
    
if K == 0:
    ans -= N

print(ans)
# Original solution
n,k=list(map(int,input().split()))
ans=0
## a<b and k>0
ans+=(n-k)*(n-k+1)//2

#print(ans)
## a>b
for i in range(k,n+1):
    for j in range(1,i):
        if i%j>=k:
            ans+=1

print(ans)


# Optimized solution
n,k=list(map(int,input().split()))
if k==0:
    print((n*n))
    exit()
ans=0
for i in range(k+1,n+1):
    ans+=((n+1)//i)*(i-k)+max(0,((n+1)%i-k))
print(ans)
# Original solution
n,k=list(map(int,input().split()))
c=0
for b in range(k+1,n+1):
  c+=n//b*(b-k)+max(n%b-k+1,0)-(k<1)
print(c)

# Optimized solution
n,k=list(map(int,input().split()))
print((sum(n//b*(b-k)+max(n%b-k+1,0)-(k<1) for b in range(k+1,n+1))))
# Original solution
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem D

if __name__ == '__main__':
    number, k = list(map(int, input().split()))
    count = 0

    # HACK: Not beautiful.
    if k == 0:
        print((number ** 2))
    else:
        for b in range(1, number + 1):
            p = (number + 1) // b
            r = number - (p * b)
            count += p * max(0, b - k)

            if (number + 1) % b != 0:
                count += max(0, r - k + 1)

        print(count)


# Optimized solution
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem D

if __name__ == '__main__':
    number, k = list(map(int, input().split()))
    count = 0

    # See:
    # https://img.atcoder.jp/arc091/editorial.pdf
    # https://beta.atcoder.jp/contests/abc090/submissions/2193514
    for b in range(1, number + 1):
        p, r = divmod(number, b)
        count += p * max(0, b - k) + max(0, r - k + 1)

    if k == 0:
        count -= number

    print(count)
# Original solution
n, k = list(map(int, input().split()))

if k == 0:
    print((n**2))
    exit()
    
ans = 0
for b in range(k+1, n+1):
    ans_bk = (n-k)//b+1
    ans_b = ans_bk*(b-k)
    
    mod_k_max = ((n-k)//b)*b+k
    if n-mod_k_max+1 < b-k:
        ans_b -= ((b-k) - (n-mod_k_max+1))
    # print(ans_b)
    ans += ans_b
            
print(ans)


# Optimized solution
n, k = list(map(int, input().split()))

if k == 0:
  print((n**2))
  exit()
    
ans = 0
for b in range(k+1, n+1):
  p = n//b
  r = n%b
  
  ans += p*(b-k)
  ans += max(0, r-k+1)
print(ans)
# Original solution
import sys

n, k = list(map(int, sys.stdin.readline().split()))

def main():
    res = 0
    for b in range(k+1, n+1):
        q, r = divmod(n, b)
        res += q * (b - k) + max(0, r - (max(k, 1) - 1))
    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

# Optimized solution
import sys

n, k = list(map(int, sys.stdin.readline().split()))

def main():
    res = 0
    for b in range(k+1, n+1):
        q, r = divmod(n, b)
        res += q * (b - k) + max(0, r - (k - 1))
    if k == 0:
        res -= n - k
    return res

if __name__ == '__main__':
    ans = main()
    print(ans)
# Original solution
N, K = list(map(int, input().split()))

count = 0
for a in range(1,N+1):
    for b in range(1,N+1):
        if a%b >= K:
            count += 1

print (count)


# Optimized solution
N, K = list(map(int, input().split()))

ans = 0
for b in range(1, N+1): #bを全探索
    amari = max(b-K, 0)
    count = N // b
    # print ('b=', b)
    # print (count * amari + max(N%b - K + 1, 0))
    ans += count * amari + max(N%b - K + 1, 0)

if K == 0:
    ans -= N
print (ans)





#以下単純な全探索O(N^2)となり間に合わない
# count = 0
# for a in range(1,N+1):
#     for b in range(1,N+1):
#         if a%b >= K:
#             count += 1

# print (count)
# Original solution
N,K = list(map(int,input().split()))
ans = 0
for b in range(K+1,N+1):
    ans += N//b*(b-K) + max(0,N%b-K+1)
if K==0:ans = N*N
print(ans)

# Optimized solution
N,K = list(map(int,input().split()))
ans = sum(N//b*(b-K) + max(0,N%b-K+1) for b in range(K+1,N+1)) if K>0 else N*N
print(ans)
# Original solution
n,k = list(map(int,input().split()))
if k == 0:
    print((n**2))
else:
    r = n//k
    ans = 0
    for i in range(1,r+3): #a=(i-1)×b+あまり
        genkai = n - (i)*k
        for j in range(1,n-k+1): #b=k+j
            x = (i-1)*j
            ans += min(max(genkai-x+1,0),j)
    print(ans)


# Optimized solution
n,k = list(map(int,input().split()))
if k == 0:
    print((n**2))
elif k <= 100:
    ans = 0
    for j in range(k):
        for i in range(k+1,n+1):
            ans += (n-j)//i
    print(((n-k+1)*(n-k)-ans))
else:
    r = n//k
    ans = 0
    for i in range(1,r+3): #a=(i-1)×b+あまり
        genkai = n - (i)*k
        for j in range(1,n-k+1): #b=k+j
            x = (i-1)*j
            ans += min(max(genkai-x+1,0),j)
    print(ans)
# Original solution
# -*- coding: utf-8 -*-

N, K = list(map(int, input().split(" ")))
c = 0

if K == 0:
    print((N*N))
else:
    for b in range(K+1, N+1):
        for a in range(K, b):
            n = (N-a)//b + 1
            c += n
            
    print(c)

# Optimized solution
# -*- coding: utf-8 -*-

N, K = list(map(int, input().split(" ")))
c = 0
 
if K != 0:
    for b in range(K+1, N+1):
        s = N % b
        t = N - s
        p = t // b * (b - K)
        q = max(0, s - (K - 1))
        c += (p + q)
        
else:
    c = N ** 2

print(c)
# Original solution
# -*- coding: utf-8 -*-

N, K = list(map(int, input().split(" ")))
c = 0
 
if K != 0:
    for b in range(K+1, N+1):
        s = N % b
        t = N - s
        p = t // b * (b - K)
        q = max(0, s - (K - 1))
        c += (p + q)
        
else:
    c = N ** 2

print(c)

# Optimized solution
# -*- coding: utf-8 -*-

N, K = list(map(int, input().split(" ")))
c = 0
 
if K != 0:
    for b in range(K+1, N+1):
        r = N % b
        p = N // b
        s = p * (b-K)
        t = max(0, r - (K - 1))
        c += (s + t)
        
else:
    c = N ** 2

print(c)
# Original solution
def As(b):
	if K==0:
		return N
	q = N//b
	# on each range we have b-K possible A's
	s = (b-K) * q
	if q*b+K <= N:
		s += min((q+1)*b-1,N) - (q*b+K-1)
	return s

N, K = list(map(int,input().split()))
s = 0; b = K+1;
while b <= N:
	s += As(b)
	b += 1
print(s)


# Optimized solution
# 解説どおりにやるとK = 0で失敗する? 
def number_of_a(b):
	if K == 0:
		return N
	q, r = divmod(N,b)
	# for each range, we have b-K possible A's
	# in the last range, we have max(0,r-K+1) possible A's.
	s = q * max(0,b-K) + max(0,r-K+1)
	# print((b,q,r,s))
	return s
 
N, K = list(map(int,input().split()))
s = 0; b = 1;
while b <= N:
	s += number_of_a(b)
	b += 1
print(s)
# Original solution
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from copy import deepcopy

INF = 10 ** 20


def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

n,k=LI()
ans=0
if k==0:
    print((n*n))
    exit()
for b in range(k+1,n+1):
    ans+=n//b*(b-k)+max(0,n%b-k+1)

print(ans)

# Optimized solution
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from copy import deepcopy

INF = 10 ** 20


def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

n,k=LI()
ans=0
if k==0:
    print((n*n))
    exit()
for b in range(k+1,n+1):
    ans+=(n+1)//b*(b-k)+max(0,(n+1)%b-k)

print(ans)
# Original solution
n,k=list(map(int,input().split()))
x=0
for b in range(k+1,n+1):
  for i in range(k,b):
    x+=(n-i)//b+(i>0)
print(x)

# Optimized solution
n,k=list(map(int,input().split()))
x=0
for b in range(k+1,n+1):
  r=n%b
  if r==0:
    x+=(n//b)*(b-k)
  else:  
    x+=(n//b+1)*max(0,(r-k+1))
    x+=(n//b)*max(0,(b-max(k,r+1)))
    if k==0:
      x-=1
print(x)
# Original solution
Tmp = []
Tmp  = input().rstrip().split(' ')

N = int(Tmp[0])
K = int(Tmp[1])

Ans = 0
Num = K + 1
nTmp = 0
nTmp2 = 0

if K == 0:
    Ans = N**2
else:
    nTmp = int((N - K)*(N - K + 1)/2)
    Ans += nTmp
    while Num < N:
        nTmp2 = N
        while nTmp2 - K >= Num:
            nTmp = nTmp2 % Num
            if nTmp >= K:
                Ans += 1
            
            nTmp2 -= 1
        
        Num += 1


print(Ans)


# Optimized solution
Tmp = []
Tmp  = input().rstrip().split(' ')

N = int(Tmp[0])
K = int(Tmp[1])

Ans = 0
nTmp = 0
nTmp2 = 0
nTmp3 = 0

if K == 0:
  Ans = N **2
else:
    for i in range(N+1):
        if i == 0:
            continue
        B = i
        nTmp = B - K
        if nTmp > 0:
            nTmp2 = N // B
            nTmp3 = (B - K) * nTmp2
            Ans += nTmp3
            nTmp2 = N % B
            if nTmp2 != 0:
                nTmp2 = nTmp2 - K + 1
                if nTmp2 > 0:
                    Ans += nTmp2
    
print(Ans)