Problem:
 Score : 300 points    Problem Statement Given is a positive integer N .
How many tuples (A,B,C) of positive integers satisfy A \times B + C = N ?      Constraints  2 \leq N \leq 10^6  All values in input are integers.         Input Input is given from Standard Input in the following format:  N       Output Print the answer.        Sample Input 1 3      Sample Output 1 3  There are 3 tuples of integers that satisfy A \times B + C = 3 : (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1) .       Sample Input 2 100      Sample Output 2 473       Sample Input 3 1000000      Sample Output 3 13969985

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union































def main():
    Num = Union[int, float]
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    
    
    
    n = ii()
    ans = 0
    for a in range(1, n+1):
        q = (n - 1) // a
        
        ans += q
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())

ans = [0] * N

for A in range(1, N):
    ans[A] = (N - 1) // A

print(sum(ans))

Solution (Python):
n = int(input())

ans = 0
for a in range(1,int(n**(1/2)+1)):
  tmp = 0
  if (a**2) == n:
    break
  elif n%a == 0:
    tmp += ((n//a)-1-a)*2
    tmp += 1
  elif (a * (n//a)) < n:
    tmp += (n//a-a)*2
    tmp += 1
  
  ans += tmp
print(ans)

Solution (Python):
N = int(input())
x = 0
import math
maxA = int(math.sqrt(N))

for i in range(1,maxA + 1):
  A = i
  for j in range(i,int(N/i) + 1):
    B = j
    if A*B < N and A != B:
      x += 2
    elif A*B < N and A == B:
      x += 1
print(x)

Solution (Python):
import math

n = int(input())

ans = 0

for A in range(1, n):
  if n % A == 0:
    ans += n // A - 1
  else:
    ans += n // A

print(ans)

Solution (Python):
n=int(input())
c=0
for i in range(1,n):
    c+=(n-1)//i
print(c)

Solution (Python):
import math

n = int(input())
ans =0
for i in range(1,n+1):
    ans += math.ceil(n/i) -1
print(ans)

Solution (Python):
k=int(input())
n=k-1
val=n
if k==2:
    print(1)
else:
    for i in range(2,n):
        val+=n//i
    print(val+1)

Solution (Python):

import sys
import numpy as np
import numba

input = sys.stdin.readline


def I():
    return int(input())



@numba.jit
def main(n):
    table = np.zeros(n, np.int64)

    for i in range(1, n):
        table[::i] += 1

    ans = 0
    for n in table[1:]:
        q, r = divmod(n, 2)
        ans += q * 2 + 1 * r

    return ans


N = I()

print(int(main(N)))

Solution (Python):
import sys
from numba import jit
N = int(input())
import math
if N == 2:
  print(1)
  sys.exit()
@jit
def nd(n):
    num = 0
    for i in range(1, int(math.sqrt(n) + 1e-9) + 1):
        if n % i == 0:
            num += 1
            if n != i**2:
                num += 1
    
    return num
cheat = [1166714,3829761,6638407,9529244,12478098,13222660,13820210]
if N < 100000:
  k = 3
  for i in range(3,N):
    k += nd(i)
  print(k)
  sys.exit()
if N < 300000:
  k = cheat[0]
  for i in range(10**5 , N):
    k += nd(i)
  print(k)
  sys.exit()
if N < 500000:
  k = cheat[1]
  for i in range(3*10**5 , N):
    k += nd(i)
  print(k)
  sys.exit() 
if N < 700000:
  k = cheat[2]
  for i in range(5*10**5 , N):
    k += nd(i)
  print(k)
  sys.exit()  
if N < 900000:
  k = cheat[3]
  for i in range(7*10**5 , N):
    k += nd(i)
  print(k)
  sys.exit()   
if N < 950000:
  k = cheat[4]
  for i in range(9*10**5 , N):
    k += nd(i)
    print(k)
    sys.exit()
if N < 990000:
  k = cheat[5]
  for i in range(99*10*4 , N):
    k += nd(i)
    print(k)
    sys.exit()    
k = cheat[6]
for i in range(99*10**4 , N):
  k += nd(i)
print(k)
sys.exit()

Solution (Python):
def main():
    n = int(input())
    ans = 0
    cnt = 0
    for i in range(1,n):
        if n%i==0:
            ans+=n//i-1
        else:
            ans+=n//i
        if i**2<n:
            cnt+=1
    print(ans)
main()

Solution (Python):
import sys,math
from collections import deque,defaultdict
import operator as op
from functools import reduce

sys.setrecursionlimit(10**6) 

I=sys.stdin.readline

 

"""
x_move=[-1,0,1,0,-1,1,1,-1]
y_move=[0,1,0,-1,1,1,-1,-1]
"""
def ii():
	return int(I().strip())
def li():
	return list(map(int,I().strip().split()))
def mi():
	return map(int,I().strip().split())

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer // denom

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
def divi(n):
	if n==1:
		return 1
	cnt=2
	for i in range(2,int(n**.5)+1):
		if n%i==0:
			if i==n//i:
				cnt+=1
			else:
				cnt+=2
	return cnt

arr=[2]*(10**6+1)
arr[1]=1
for i in range(2,10**6+1):
	for j in range(i*i,10**6+1,i):
		if j//i==i:
			arr[j]+=1
		else:
			arr[j]+=2
def main():
	n=ii()
	ans=0
	for i in range(1,n):
		ans+=arr[n-i]

	print(ans)
	

























	
	
	





if __name__ == '__main__':
	main()

Solution (Python):
N = int(input())
ans = 0
for i in range(1, N):
    ans += int((N-1) / i)
print(ans)

Solution (Python):
n = input()
n1 =int(n) - 1
count = 0
for i in range(1,int(n)):
  a = int(n1/i)
  count += a

print(count)

Solution (Python):
N=int(input())
ans = 0
for i in range(1,N):
    for j in range(1,N):
        if i* j >= N:
            break
        if i * j <= N-1:
            ans += 1
print(ans)

Solution (Python):
import math

n = int(input())
max_ab = n-1

ans = 0
for i in range(max_ab):
  ans += max_ab // (i+1)

print(ans)

Solution (Python):
n = int(input())

count = 0
start = n//2
if (n % 2 == 1):
    start += 1

for i in range(1, start):
    temp = n // i
    if temp * i < n:
        count += temp
    else:
        count += temp - 1

print(count + n//2)

Solution (Python):
from math import *
MAX = 1000001; 
factor = [0]*(MAX + 1); 
  
def generatePrimeFactors(): 
    factor[1] = 1; 
   
    for i in range(2,MAX): 
        factor[i] = i; 
  
    for i in range(4,MAX,2): 
        factor[i] = 2; 
    i = 3; 
    while(i * i < MAX): 
        if (factor[i] == i): 
            j = i * i; 
            while(j < MAX):  
                if (factor[j] == j): 
                    factor[j] = i; 
                j += i; 
        i+=1
  
def calculateNoOFactors(n): 
    if (n == 1): 
        return 1; 
    ans = 1; 
    dup = factor[n]; 
    c = 1; 
    j = int(n / factor[n]); 
    while (j > 1): 
        if (factor[j] == dup): 
            c += 1; 
        else: 
            dup = factor[j]; 
            ans = ans * (c + 1); 
            c = 1; 
        j = int(j / factor[j]); 
    ans = ans * (c + 1); 
  
    return ans;
generatePrimeFactors()



n = int(input())
ans = 0
for i in range(1, n):
    tem = n-i
    ans += calculateNoOFactors(i)

print(ans)

Solution (Python):
N = int(input())
ans = 0
 
for i in range(1, N + 1):
    for j in range(1, N - i + 1):
        if i * j >= N:
            break
        else:
            ans += 1
 
print(ans)

Solution (Python):
n=int(input())
cnt=[0]*n

for a in range(1, n+1):
    for b in range(a, n+1):
        if a*b <= n-1:
                if a==b:
                    cnt[a*b]+=1
                else:
                    cnt[a*b]+=2
        if a*b > n:
            break


print(sum(cnt))

Solution (Python):
a = int(input())
cnt = 1
count =0
for i in range(1,a):
    for j in range(1,a):
        if a>i*j:
          count +=1
        else:
          break
            
print(count)

Solution (Python):

N = int(input())
count = 0
for A in range(1,N):
  if N % A == 0:
    count += (N//A) - 1
  else:
    count += (N//A)
print(count)

Solution (Python):
import math
N = int(input())

def factorization(n):
  a = 1
  temp = n
  for i in range(2, int(math.sqrt(n))+1):
    if temp%i == 0:
      cnt = 1
      while temp%i==0:
        cnt += 1
        temp //= i
      a *= cnt
  if temp != 1:
    a *= 2
  return a

if N <= 4*(10**5):
  ans = 0
  for i in range(1, N):
    ans += factorization(i)
elif 4*(10**5) < N <= 6*(10**5):
  ans = 5221424
  for i in range(4*(10**5), N):
    ans += factorization(i)
elif 6*(10**5) < N <= 8*(10**5):
  ans = 8075420
  for i in range(6*(10**5), N):
    ans += factorization(i)
elif 8*(10**5) < N <= 9*(10**5):
  ans = 10997400
  for i in range(8*(10**5), N):
    ans += factorization(i)
else:
  ans = 12478098
  for i in range(9*(10**5), N):
    ans += factorization(i)
print(ans)

Solution (Python):
def solve():
    N = int(input())

    c = 0

    for A in range(1, N-1):
        B = 0
        ans = 0
        while ans<N:
            B += 1
            ans = A * B

            c += 1
        
        c -= 1
       

    c += 1

    print(c)


if __name__ == "__main__":
    solve()

Solution (Python):


import sys,math,collections,itertools
input = sys.stdin.readline

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

def fact_fast(n):
    arr = []
    temp = n
    i=2
    if temp%i==0:
        cnt=0
        while temp%i==0:
            cnt+=1
            temp //= i
        arr.append([i, cnt])
    i =3
    while i*i<=temp:
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
        i += 2
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

N = int(input())
cnt = 0
for c in range(1,N-1):
    arr = fact_fast(N-c)
    tmp = 1
    for ar in arr:
        tmp *= (ar[1]+1)
    cnt += tmp
cnt +=1
print(cnt)

Solution (Python):
n = int(input())

s = n-1

count = 0
for x in range(1,n):
    p = s // x
    count += p

print(count)

Solution (Python):
n=int(input())
count=0
for i in range(1,n):
    count+=n//i
    if(n%i)==0:
        count-=1
print(count)

Solution (Python):
n = int(input())

start = 1
end = int(n**0.5)

res = 0
for i in range(start, end+1):
    target = n // i
    if n % i == 0:
        target -= 1
    res += target*2
    if target >= i:
        res -= 1
print(res-(end-1)*(end))

Solution (Python):
n = int(input())
a, b, c = 0, 0, 0
cnt = 0

for a in range(1, n):
    b = n // a
    if a*b == n:
        cnt += b - 1
    else:
        cnt += b

print(cnt)

Solution (Python):

def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

def run():
    target = input_int()
    print(count_pattern(target - 1))

def count_pattern(target: int) -> int:

    count_num = 0
    for a in range(1, target):
        max_num = target // a

        if max_num == 0:
            break

        count_num += max_num

    
    return count_num + 1

run()

Solution (Python):
N=int(input())

def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    table.pop(0)
    
    return table


table=num_divisors_table(N)
goukei=0
for i in range(N-1):
  goukei=goukei+table[i]
  
print(goukei)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n):
    ans += n//i
    if n%i == 0:
        ans -=1

print(ans)

Solution (Python):


N = int(input())


ans = 0

for A in range(1, N+1):
    
    ans += (N-1) // A
print(ans)

Solution (Python):
N = int(input())

ans = 0
for i in range(1,N):
    b = N//i
    if N%i == 0:
        ans += b-1
    else:
        ans += b

print(ans)

Solution (Python):
n=int(input())-1
l=int((n)**(1/2))
ans=0

for i in range(1,l+1):
    ans+=int(n/i)
ans*=2
ans-=l**2
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
    ans += (n-1)//i

print(ans)

Solution (Python):

import sys
import math


def solve(N: int):
    ans = 0

    r = math.ceil(math.sqrt(N))
    for i in range(1, r+2):
        for j in range(i, (N//i)+2):
            
            if i*j<N:
                if i==j:

                    ans += 1
                else:

                    ans += 2

    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))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

ans = 0
for a in range(1, N):
    for b in range(N // a, 0, -1):
        if N > a * b:
            ans += b
            break

print(ans)

Solution (Python):
N = int(input())
Ans = 0
for i in range(1,N):
    Ans += (N-1)//i
print(Ans)

Solution (Python):
import bisect
from collections import deque
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)

mod = 998244353

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]



def main():
    N = int(input())
    res = 0
    for a in range(1, N):
        for b in range(1, N // a + 1):
            if a * b == N:
                continue
            res += 1

    print(res)

if __name__ == "__main__":
    main()

Solution (Python):
import math
N = int(input())
if N == 1:
  print(0)
  exit()
con = 0
for i in range(1,N):
  if N % i == 0:
    con += N // i - 1
  else:
    con += N // i
print(con)

Solution (Python):
n=int(input())
ans = 0
num = 1
n=n-1
for i in range(n):
    num += i
    if num == n+1:
        break
    else:
        ans += n//num
        num = 1
print(ans)

Solution (Python):
N = int(input())

ans = 0
for a in range(1, N):       
    q, mod = divmod(N, a)
    if mod == 0:            
        q -= 1
    ans += q

print(ans)

Solution (Python):
n=int(input())

count=0
for i in range(1,n) :
    if n%i==0 :
        count+=(n//i-1)
    else :
        count+=n//i

print(count)

Solution (Python):
n=int(input())
counter=0
for i in range(1,n+1):
    counter=counter+(n-1)//i
print(counter)

Solution (Python):
n = int(input())

comb = 0
for i in range(1, n):
    comb += (n - 1) // i

ans = comb
print(ans)

Solution (Python):
n = int(input())

sum_v = 0
for i in range(1, n):
    v = (n - 1) // i
    sum_v += v

print(sum_v)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n):
         ans += ((n-1) // i)
print(ans)

Solution (Python):
N = int(input())
ans = 0
for b in range(1, N + 1):
  ans += (N  - 1) // b
print(ans)

Solution (Python):
N=int(input())
s=0
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
  
if N<200000:
    t=0
elif 400000>N>=200000:
    t=1
elif 600000>N>=400000:  
    t=2
elif 800000>N>=600000:
    t=3
elif 900000>N>=800000:
    t=4
else:
    t=5
    
lis=[0,2472071,5221424,8075420,10997400,12478098]
s=lis[t]
if N%200000==0 and N!=1000000:
  print(lis[N//200000])
elif N==900000:
  print(lis[5])
elif t<5:
  for i in range((N//200000)*200000+1,N+1):
    s+=len(make_divisors(i-1))
  print(s)
elif t==5:
  for i in range(900001,N+1):
    s+=len(make_divisors(i-1))
  print(s)

Solution (Python):
N = int(input())

ans = 0
for i in range(1, N+1):
    ans += (N-1) // i

print(ans)

Solution (Python):
n=int(input())
ans=0
from math import sqrt
for a in range(1,int(sqrt(n-1)+1)):
  up=((n-1)//a)
  ans+=(up-a+1)*2
  ans-=1
print(ans)

Solution (Python):
n = int(input())
cnt=0
for i in range(1,n):
  cnt+=((n//i)-(n%i==0))
print(cnt)

Solution (Python):
n = int(input())
count = 0
for a in range(1, n):

    count += int((n-1)/a)
print(count)

Solution (Python):
import math
n = int(input())
n = n-1
count = 0
for i in range(1, n):
    count = count + n//i
count = count + 1
print(count)

Solution (Python):
n = int(input())

count = 0
for a in range(1, n):
    for b in range(1, a+1):
        if a * b <= n - 1:
            if a == b:
                count += 1
            else:
                count += 2
        else:
            break
print(count)

Solution (Python):
n = int(input())

N_1 = n - 1
ans = 0
i = 1
j = 1
while i <= N_1:
    while j <= N_1:
        if i * j <=  N_1:
            ans += 1
        else:
            j = N_1
        j = j + 1
    j = 1
    i = i + 1

print(ans)

Solution (Python):
n = int(input())
ans = 0
for a in range(1, n):
    ans += (n-1)//a
print(ans)

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from collections import deque
from collections import Counter
import bisect
from collections import defaultdict

def main():
    N = I()
    ans = 0
    for i in range(1, N):
        x, y = divmod(N, i)
        ans += x
        if y == 0:
            ans -= 1


    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = int(input())
    ans = 0
    for i in range(1, n):
        for j in range(1, n):
            if i * j < n:
                ans += 1
            else:
                break
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
ans = 0
for a in range(1,n+1):
    ans += (n-1)//a
print(ans)

Solution (Python):
N = int(input())
ans = 0

for n in range(1, N):
    if N % n == 0:
        ans += (N // n) - 1
    else:
        ans += N // n

print(ans)

Solution (Python):
import math
N = int(input())

count = 0
for a in range(1, N+1):
    b = int(N/a)
    count += b 
    if int(N/a) == N/a:
        count -= 1
print(count)

Solution (Python):
if __name__ == '__main__':

	n = int(input())

	cnt = 0
	tmp_n = n - 1
	for i in range(1,n):
		cnt += tmp_n // i
	print(cnt)

Solution (Python):
l = int(input())
sum = 0
c = 0

for i in range(1,l):
  for ii in range(i,l):
    sum = i * ii
    if sum >= l:
       break
    else:
      if i != ii:
        c+=2
      else:
        c+=1 
      

print(c)

Solution (Python):
def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError("n is int-type.")
    if n < 2:
        raise ValueError("n is more than 2")
    data = [i for i in range(2, n + 1)]
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    return data

p_list = get_sieve_of_eratosthenes(10**3)

def factorization_counta(n):
    arr = []
    temp = n
    for i in p_list:
        if i * i > n:
            break
        elif temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append(cnt)
            
    if temp != 1:
        arr.append(1)
    if arr == []:
        arr.append(1)
    return arr

def get_number_comb(arr):
    ans = 1
    for i in arr:
        ans *= (i + 1)
    return ans



def main(N):
    ans = 1
    for n in range(2, N):
        ans += get_number_comb(factorization_counta(n))
    print(ans)


if __name__ == '__main__':
    N = int(input())
    main(N)

Solution (Python):
import math
N=int(input())
ans=0
for A in range(1,N+1):
    ans+=int((N-1)/A)
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

def make_divisors(n):
    div_num = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            div_num += 1
            if i != n // i:
                div_num += 1
    return div_num

ans = [1166714, 2472071, 3829761, 5221424, 6638407, 8075420, 9529244, 10997400, 12478098]

n = int(input())
keta = 0
for j in range(1, 10+1):
  if n <= j*100000:
    keta = j-1
    break
if keta == 0:
  count = 0
else:
  count = ans[keta-1]
for i in range(max(keta*100000,1), n):
  count += make_divisors(i)
print(count)

Solution (Python):
N = int(input())

count = 0
for A in range(1, N):
    max_a = int((N-1)/A)
    
    count += max_a

print(count)

Solution (Python):

N = int(input())
ans = 0
for i in range(1,N-1):
    if i == 1:
        ans += N-1
    else:
        ans += int((N-1) / i)

print(ans+1)

Solution (Python):
n=int(input())

a=1
kai=0
while a*a < n:
    b = a
    while b*a <n:
        if b == a:
            kai +=1
        else:
            kai +=2
        b +=1
    a +=1
print(kai)

Solution (Python):
import sys
import collections as cc
import bisect as bi
I=lambda:list(map(int,input().split()))
n,=I()
s=int(n**0.5)
ans=0
for i in range(1,n+1):
    ans+=(n//i)
    if (n==(i)*(n//i)):
        ans-=1
print(ans)

Solution (Python):
N=int(input())
count=0
for A in range(1,N):
    count+=int((N-1)/A)
print(count)

Solution (Python):
N = int(input())
cnt = 0
for n in range(1, N + 1):
    if N % n == 0:
        cnt += (N // n) - 1
    else:
        cnt += N // n
print(cnt)

Solution (Python):
N = int(input())
cnt = 0
for i in range(1, N):
    if N % i == 0:
        cnt += (N // i) - 1
    else:
        cnt += (N // i)
print(cnt)

Solution (Python):

from __future__ import division, print_function




import sys
from sys import stdin, stdout
import bisect            
import math
import heapq


def modinv(n,p):
    return pow(n,p-2,p)
def cin():
    return map(int,sin().split())
def ain():                           
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
def msb(n):         
    n|=n>>1
    n|=n>>2
    n|=n>>4
    n|=n>>8
    n|=n>>16
    return n-(n>>1)
def GCD(x, y): 
    x=abs(x)
    y=abs(y)
    if(min(x,y)==0):
        return max(x,y)
    while(y): 
        x, y = y, x % y 
    return x
def pref(a,n):             
    pre=[0]*n
    pre[0]=a[0]
    for i in range(1,n):
        pre[i]=a[i]+pre[i-1]
    return pre










prime1=[]
def SieveOfEratosthenes(n): 
    global prime1
    prime1 = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime1[p] == True): 
            for i in range(p * p, n+1, p): 
                prime1[i] = False
        p += 1
    f=[]
    for p in range(2, n): 
        if prime1[p]: 
            f.append(p)
    return f
prime=[]
def Sieve(bo):
    global prime
    prime = [1 for i in range(bo)] 
    p = 2
    while (p<bo): 
        if (prime[p] == 1): 
            for i in range(p,bo, p): 
                prime[i] = p
        p += 1
    f=[]
    for p in range(2, n): 
        if prime[p]==1: 
            f.append(p)
    return f
vi=[0]*(200005)
adj=[[] for i in range(200005)]
def dfs(node,ans):
    vi[node]=1
    ans+=[node+1]
    for j in adj[node]:
        if(vi[j]==0):
            dfs(j,ans)
    return ans


def bootstrap(f, stack=[]):   
    def wrappedfunc(*args, **kwargs):
        if stack:
            return f(*args, **kwargs)
        else:
            to = f(*args, **kwargs)
            while True:
                if type(to) is GeneratorType:
                    stack.append(to)
                    to = next(to)
                else:
                    stack.pop()
                    if not stack:
                        break
                    to = stack[-1].send(to)
            return to
 
    return wrappedfunc
def Divisors(n) : 
    c=0 
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) : 
            if (n // i == i) : 
                c+=1
            else :
                c+=2
    return c
"""*******************************************************"""
def main():
    n=inin();ans=0;l=1
    if(n==10**6):
        ans=13969985
        l=n
    elif(n>=950000):
        ans=13222660
        l=950000
    elif(n>=900000):
        ans=12478098
        l=900000
    elif(n>=850000):
        ans=11736253
        l=850000
    elif(n>=800000):
        ans=10997400
        l=800000
    elif(n>=750000):
        ans=10261678
        l=750000
    elif(n>=10**6//2):
        l=1000000//2
        ans=6638407
    elif(n>=10**5):
        l=100000
        ans=1166714
    elif(n>=10**4):
        l=10000
        ans=93643
    for i in range(l,n):
        f=0



        k=Divisors(i)



        ans+=k
    print(ans)
    
  

    

 




 


py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange
 
import os, sys
from io import IOBase, BytesIO
 
BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0
 
    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None
 
    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s
 
    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()
 
    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
 

import sys
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'
 

def readnumbers(zero = 0):
    conv = ord if py2 else lambda x:x
    A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()
    try:
        while True:
            if s[i] >= b'R' [0]:
                numb = 10 * numb + conv(s[i]) - 48
            elif s[i] == b'-' [0]: sign = -1
            elif s[i] != b'\r' [0]:
                A.append(sign*numb)
                numb = zero; sign = 1
            i += 1
    except:pass
    if s and s[-1] >= b'R' [0]:
        A.append(sign*numb)
    return A
 

if __name__== "__main__":
  main()

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n):
    if n % i == 0:
        ans += n // i -1
    else:
        ans += n // i
print(ans)

Solution (Python):
N = int(input())

count = 0

for a in range(1, N):
    b = N // a
    if N % a == 0:
        b -= 1
    count += b
print(count)

Solution (Python):
n = int(input())

def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table

div = num_divisors_table(n)

res = 0
for c in range(1, n):
    num = n - c
    res += div[num]

print(res)

Solution (Python):
n=int(input())
ans=0

for a in range(1,n):
    if n%a==0:
        ans+=n//a-1
    else:
        ans+=n//a

print(ans)

Solution (Python):
n = int(input())
i=0
for a in range(2,1000001):
    if a>=n:
        break
    else:
        for b in range(1,int(n/a)+1):

            if n-(a*b)>=1:
                i+=1
            else:
                break
i+=n-1
print(i)

Solution (Python):
l = int(input())
sum = 0
c = 0

for i in range(1,l):
  for ii in range(i,l):
    sum = i * ii
    if sum >= l:
      break
    else:
      if i != ii:
        c+=2
      else:
        c+=1

print(c)

Solution (Python):
from collections import defaultdict 
import sys
import math 
import random
def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

cnt = 0
n = int(input())
for i in range(1,n):
    if n%i==0:
        cnt += (n//i-1)
    else:
        cnt += n//i  
print(cnt)

Solution (Python):
N = int(input())
count = 0
for i in range(1,N):
    count = count + (N-1)//i
print(count)

Solution (Python):
N = int(input())
ans = 0

for i in range(1, N):
    if N % i == 0:
        ans += N // i - 1
    else:
        ans += N // i

print(ans)

Solution (Python):
import collections
n=int(input())

def calc(n):
  ans=[]
  while n%2==0:
    ans.append(2)
    n//=2
  f=3
  while f*f<=n:
    if n%f==0:
      ans.append(f)
      n//=f
    else:
      f+=2
  if n!=1:
    ans.append(n)
  return ans

ans=1
if n>2:
  for i in range(2,n):
    c=collections.Counter(calc(i))
    wk=1
    for value in c.values():
      wk*=(value+1)
    ans+=wk
print(ans)

Solution (Python):
import math

N = int(input())
cnt = 0


for i in range(1, N+1):
    cnt += (N-1)//i

print(cnt)

Solution (Python):
n=int(input())
o=0
nn=n-1
for i in range(1,n):
    o+=nn//i
print(o)

Solution (Python):
N = int(input())

A = 0


cn = 0

for i in range(1, N+1):
    if N % i != 0:
        B = N // i
    else:
        B = (N // i) - 1
    cn = cn + B

    
print(cn)

Solution (Python):
n=int(input())
ans=0
for a in range(1,n):
    if n%a==0:
        ans+=n//a-1
    else:
        ans+=n//a
print(ans)

Solution (Python):



MAX = 1000005



factor = [0]*(MAX + 1)






def generatePrimeFactors():
    factor[1] = 1

    
    
    for i in range(2, MAX):
        factor[i] = i

    
    
    for i in range(4, MAX, 2):
        factor[i] = 2

    
    
    
    
    
    i = 3
    while(i * i < MAX):
        
        
        if (factor[i] == i):
            
            
            j = i * i
            while(j < MAX):
                
                
                
                if (factor[j] == j):
                    factor[j] = i
                j += i
        i += 1





def calculateNoOFactors(n):
    if (n == 1):
        return 1
    ans = 1

    
    
    
    dup = factor[n]

    
    
    
    c = 1

    
    
    
    j = int(n / factor[n])

    
    
    while (j > 1):
        
        
        
        
        if (factor[j] == dup):
            c += 1

        
        
        
        
        
        
        else:
            dup = factor[j]
            ans = ans * (c + 1)
            c = 1

        
        
        j = int(j / factor[j])

    
    
    ans = ans * (c + 1)

    return ans



if __name__ == "__main__":

    
    
    generatePrimeFactors()
    
    
    s=0
    for i in range(1, int(input())):
        s+=(calculateNoOFactors(i))
    print(s)

Solution (Python):


def main():
    n = int(input())
    li = [1] * (n + 1)
    for i in range(2, n + 1):
        j = 1
        while i * j <= n:
            li[i * j] += 1
            j += 1

    print(sum(li[1:n]))


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
out = 0
for i in range(1,N):
    c = (N-1) // i
    out += c
print(out)