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 itertools
import collections

N = int(input())

def prime_factor_table(n):
    table = [0] * (n + 1)
    
    for i in xrange(2, n + 1):
        if table[i] == 0:
            for j in xrange(i + i, n + 1, i):
                table[j] = i
    
    return table

def prime_factor(n, prime_factor_table):
    prime_count = collections.Counter()
    
    while prime_factor_table[n] != 0:
        prime_count[prime_factor_table[n]] += 1
        n /= prime_factor_table[n]
    prime_count[n] += 1
    
    return prime_count

t = prime_factor_table(N)

ans = 0
for c in range(1,N-1):
  ab = N-c
  f = prime_factor(ab,t)
  v = f.values()
  tmp = 1
  for i in range(len(f)):
    tmp *= v[i]+1
  ans += tmp
  
print(ans+1)

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

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

print(ans)

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

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

Solution (Python):
import numpy as np
import sys





n = int(input())
count = 0
count2 = 0


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

print(count)

Solution (Python):
n = int(input())
cnt = 0
flag = 0
a = int(n ** 0.5)
if a == n ** 0.5:
    flag = 1
for i in range(1,a + 1):
    for j in range(i, n):
        if i * j < n:
            cnt += 1
        else:
            break
if flag == 1:
    num = (cnt - a + 1) * 2 + a - 1
else:
    num = (cnt - a) * 2 + a
print(num)

Solution (Python):
n = int(input())
divisors_list = [0] * (n + 1)

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

ans = sum(divisors_list) - divisors_list[-1]
print(ans)

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

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

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 A in range(1,N,1):
  if N%A == 0: ans += int(N/A) - 1
  else: ans += int(N/A)

print(ans)

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

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

Solution (Python):

import math
n = int(input())
n_rev = int(math.sqrt(n))

cnt = 0
for i in range(1, n_rev + 1):
    if ((n - 1) // i - i) * 2 + 1 >= 0:
        cnt += ((n - 1) // i - i) * 2 + 1

print(cnt)

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

table = [0] * (N+5)

for i in range(1, N+3):
    for j in range(i, N+2, i):
        table[j] += 1
ans = 0
for i in range(N):
    ans += table[i]

print(ans)

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

while A*A < N:
  if N%A == 0:
    ans += N//A-A
  else:
    ans += N//A-A+1
  A += 1

ans = 2*ans - A + 1

print(ans)

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

a = 1
ans = 0

while a< N:
    b = a+1
    while a*b < N:
        ans += 2
        b += 1
    a+=1
a=1
while a**2 < N:
    ans+=1
    a += 1
print(ans)

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())
g=0
for i in range(n-1):
  g=g+int((n-1)/(i+1))
print(g)

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

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

print(ans)

Solution (Python):

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

print(ans+1)

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

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

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

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

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

Solution (Python):

import sys


def main():
    N = int( sys.stdin.readline() )

    cnt = 0

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


if __name__ == "__main__":
    main()

Solution (Python):
table = [0]*(10**6)

for i in range(1,10**6):
  for j in range(i,10**6,i):
    table[j] += 1

N = int(input())
table_ans = table[:N]
print(sum(table_ans))

Solution (Python):
import sys,math,collections
from collections import defaultdict


    
def file():
    sys.stdin = open('input.py', 'r')
    sys.stdout = open('output.py', 'w') 
def get_array():
    l=list(map(int, input().split()))
    return l
def get_ints():   
    return map(int, input().split())
    
def get_3_ints():   
    a,b,c=map(int, input().split())
    return a,b,c    
def sod(n):
    n,c=str(n),0
    for i in n: 
        c+=int(i)
    return c    
def isPrime(n):
    if (n <= 1):
        return False
    if (n <= 3):
        return True
    if (n % 2 == 0 or n % 3 == 0):
        return False
    i = 5
    while(i * i <= n):
        if (n % i == 0 or n % (i + 2) == 0):
            return False
        i = i + 6
  
    return True
def getFloor(A, x):

    (left, right) = (0, len(A) - 1)

    floor = -1
    while left <= right:
        mid = (left + right) // 2
        if A[mid] == x:
            return A[mid]
        elif x < A[mid]:
            right = mid - 1
        else:
            floor = A[mid]
            left = mid + 1
            
    return floor
def chk(aa,bb):
	f=0
	for i in aa:
		for j in bb:
			if(j[0]>=i[0] and j[1]<=i[1]):
				f+=1
			elif(j[0]<=i[0] and j[1]>=i[1]):	
				f+=1
			elif(i[0]==j[1] or i[1]==j[0]):
				f+=1
			else:
				continue
	return f			


def main():
	n=int(input())
	c=0
	for i in range(1,n+1):
		t=n/i
		
		if(t==int(t)):
			c+=(int(t)-1)
		else:
			c+=int(t)
	print(c)			

		




				





		


	





        
            
        























    

    
    

        











        
        

        























































                

            







            
            
































        








if __name__ == '__main__':
    main()

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

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

count = 0
flag = False

for c in range(1, a):
    for d in range(1, a):
        if c * d >= a:
            break
        else:
            count += 1
print(count)

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

Solution (Python):
def main():
    N = int(input())
    count = N-1
    for i in range(2, N):
        count += int((N-1)/i)
        

    return count

"""
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 __name__ == '__main__':
    print(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,int((N)**0.5)+2):
  for B in range(A,int((N)/A)+2):
    if A*B < N:
      count += 1
      if A != B:
        count += 1
print(count)

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

a = n-1 
count = 0 
d = 0

for l in range(n):
  d = int(a/(l+1))
  
  if d >= (l+1):
    count += (d-l-1)*2+1
  else:
    break

print(count)

Solution (Python):

n=int(input())

icnt=0
for ai in range(1,n):
    icnt+=(n-1)//ai
    
print(icnt)

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

Solution (Python):
def i_input(): return int(input())


n = i_input()
cnt = 0

for i in range(1, n):
    q = n // i
    r = n % i
    if q != 0 and r != 0:
        cnt += q
    elif q != 0 and r == 0:
        cnt += q - 1

print(cnt)

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

c=0
for i in range(n):
    a = i+1
    for j in range(n-a+1):
        d = a*(j+1+i)
        if(d >= n):
            tmp = j*2-1
            if(tmp < 0):
                print(c)
                exit()
            c += j*2-1
            break

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

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

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

Solution (Python):
N = int(input())
rt = int(N ** 0.5)

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

Solution (Python):

def main():
    n = int(input())

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

    print(ans)


main()

Solution (Python):
import sys
import math
import itertools
import collections
from collections import deque
from collections import defaultdict

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
MOD2 = 998244353
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: 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


def main():
    N = NI()
    print(sum(num_divisors_table(N-1)))

if __name__ == '__main__':
    main()

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

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())
root = int((n - 1)** 0.5)
count = 0
for i in range(1, root + 1):
    if (n - i * i)  % i == 0:
        count +=  (n - i * i)  // i * 2 - 1
    else:
        count +=  (n - i * i)  // i * 2 + 1

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

table = num_divisors_table(1000000)

ans = 0

for c in range(1,N):
    ans += table[N-c]

print(ans)

Solution (Python):
import math

N = int(input())




count = 0
for i in range(N):
  count += (N-1) // (i+1)
  
print(count)

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

cnt=0

for i in range(1,N+1):
  for j in range(1,i+1):
    buf=N-i*j
    if buf>0:
      if i==j:
        cnt+=1
      else:
        cnt+=2
    else:
      break
  

print(cnt)

Solution (Python):
N=int(input())
def test(n):
    buf=0
    for i in range(1,n):
        if i**2 > n:
            break
        if i**2 == n:
            buf+=1
            break
        if n%i==0:
            buf+=2
    return buf

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

print(ans)

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

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

Solution (Python):
import sys
from sys import exit
from math import gcd, factorial, ceil, floor, sqrt
from bisect import bisect_left, bisect_right
from copy import deepcopy
from heapq import heapify, heappop, heappush
from itertools import permutations, combinations, product, accumulate
from collections import defaultdict, deque, Counter
sys.setrecursionlimit(10**7)

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

N = int(input())

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

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

count = 0

for i in range(1 ,n) :
    count += math.floor((n - 1) / i)

print(count)

Solution (Python):
N = int(input())
ans = 0
for a in range(1, N):
    div, mod = divmod(N, a)
    if mod == 0:
        ans += div - 1
    else:
        ans += div
print(ans)

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

count = 0

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

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

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

print(cnt)

Solution (Python):
from math import *
from collections import *
from itertools import *
from functools import *
from bisect import *
from heapq import *
from operator import *
from sys import *
setrecursionlimit(100000000)


n=int(input())
if n==2:
    print(1)
    exit()
ans=0
for x in range(1,n):
    if (n-x*x)>0:
        ans+=1
        ans+=(((n-1)-x*x)//x)*2
print(ans)

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

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

print(ans)

Solution (Python):


N = int(input())

count = 0

for i in range(N-1):
    for j in range(N-1):
        if((i+1)*(j+1) < N):
            count = count + 1
        else:
            break
print(count)

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

i_Divs = [0] * (N+1)
base = 1
Max = int(N**0.5)+1
while base < Max:
    now = base
    while now <= N:
        if now//base >= Max:
            i_Divs[now] += 2
        else:
            
            i_Divs[now] += 1
        now += base
    base += 1


ans = 0
for c in range(1,N):
    p = N-c
    ans += i_Divs[p]
print(ans)

Solution (Python):
import math
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
print(sum(num_divisors_table(N-1)))

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

import collections

N = int(input())

ans = 1
for n in range(2,N):
    a = prime_factorize(n)
    c = collections.Counter(a)
    ans_ = 1
    for i in c.values():
        ans_ *= (i+1)
    ans += ans_
print(ans)

Solution (Python):
import math


def main():
    n = int(input())
    sum = (n-1)*2-1
    for i in range(2, n):
        sho = n // i
        amari = n % i
        if i**2 >= n:
            break
        if amari == 0:
            sho -= 1
        sum += (sho - i+1) * 2 - 1
    print(sum)


if __name__ == "__main__":
    main()

Solution (Python):
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
def resolve():
    n = int(input())
    print(sum(num_divisors_table((n)-1)))
resolve()

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

Solution (Python):
nn = int(input())
count = 0
tt = nn
tt = tt-1
while tt > 0:
    count = count + int((nn-1)/tt)
    tt = tt - 1
print(count)

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

Solution (Python):
N = int(input())
counter = 0
for i in range(1,N):
    if (i**0.5).is_integer():
        
        counter += (N-1)//i
    else:
        
        counter += (N-1)//i
print(counter)

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

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

Solution (Python):
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
  

N=int(input())

ans = 0






a = num_divisors_table(N)

print(sum(a[1:-1]))

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

ans = 0

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

print(ans)

Solution (Python):
import math
N = int(input())
ans =0
for a in range(1,N):
  if N%a == 0:
    ans += math.floor(N / a) -1
  else:
    ans += math.floor(N / a)
print(ans)

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

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

for i in range(1,n):
    b = n//i
    c = n%i
    if c:
        cnt += b
    else:
        cnt += b-1
    

print(cnt)

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

def cal2(a):
    if N % a == 0:
        return N // a - 1
    else:
        return N // a
cnt = 0

for a in range(1,N + 1):
    cnt += cal2(a)

print(cnt)

Solution (Python):

N = int(input())
cnt = 0
for i in range(N):
    ii = i + 1
    for j in range(N+1):
        jj = j + 1
        if N-(ii*jj) > 0:
            cnt += 1
        else:
            break
print(cnt)

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

    duplicate = 0
    count = 0
    for i in range(1, N):
        count += (N - 1) // i
        if i * i < N:
            duplicate += 1

    print(count)


main()

Solution (Python):


def main():
    n = int(input())
    
    ans = 0
    for i in range(1, n+1):
        ans += n // i
        if i * (n // i) == n:
            ans -= 1
            
    print(int(ans))
        
    
main()

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

for i in range(N-1) :
    A = i + 1
    if A == 1 :
        cnt += N - 1
    else :
        if N % A == 0 :
            cnt += N // A -1
        else :
            cnt += N//A
print(cnt)

Solution (Python):
N = int(input())
count = 0
for i in range(1,N):
    q,mod = divmod(N,i)
    
    if mod == 0:
        q -= 1
    if q-i >= 0:
        count += (q-i)*2 + 1
    else:
        break
print(count)

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

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

ans = 0

for a in range(1, N+1):
    if N%a==0:
        b_max = int(N/a)-1
    else:
        b_max = int(N//a)
    
    ans += b_max
print(ans)

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

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

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

cnt = 0
for a in range(1, 10 ** 6 + 1):
    for b in range(1, 10 ** 6 + 1):
        if N - a * b <= 0:
            break
        if N - a * b > 0:
            cnt += 1

print(cnt)

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

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

print(cnt)

Solution (Python):
import numpy as np
num=int(input())
count=0
for a in range(num-1):
  tmp=int(num/(a+1))
  if num%(a+1)==0:
    count+=tmp-1
  else:
    count+=tmp
print(count)

Solution (Python):
n = int(input())
count = ((n-1) * 2) -1

for i in range(2,n):
  if(i*2 >= n):
    break
  for j in range(2,n):
    if(i*j < n):
      count += 1
    else:
      break
    
print(count)

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

for A in range(1, N):
  for B in range(1, N):
    if N-A*B < 1:
      break
    count += 1

print(count)

Solution (Python):
def resolve():
    import sys

    input = sys.stdin.readline

    n = int(input().rstrip())

    ans = 0


    for a in range(1, n):
        
        max_b = (n - 1) // a

        if max_b < a:
            ans += (max_b) * 2
        else:
            ans += (a - 1) * 2 + 1


    print(ans)

if __name__ == "__main__":
    resolve()

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

count = 0

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

print(count)

Solution (Python):

import sys
import math
import itertools

n = int(input())

answer =0

for a in range(1,n):
    answer += ((n-1)//a)

print(answer)

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

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

print(cnt)

Solution (Python):
import math


n = int(input())

def main():
    cnt = 0
    for a in range(1, n):
        if a < n/a:
            m = int(n/a)
            for b in range(a,m+2):
                if a * b < n :
                    if a == b :
                        cnt += 1
                    else :
                        cnt += 2
    print(cnt)


if __name__ == '__main__':
    main()

Solution (Python):

import sys,math
try:sys.stdin,sys.stdout=open('input.txt','r'),open('out.txt','w')
except:pass
from sys import stdin,stdout;mod=int(1e9 + 7);from statistics import mode
from collections import *;from math import ceil,floor,inf,factorial,gcd,log2,sqrt,log
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()


def lcm(a,b): return (a*b)//gcd(a,b)
def setbits(n):return bin(n).count('1')
def resetbits(n):return bin(n).count('0')
def modinv(n,p):return pow(n,p-2,p)
def ncr(n,r):
    num,den=1,1;r=min(n,n-r)
    for i in range(r):num*=(n-i);den*=(i+1)
    return num//den
def ncr_p(n, r, p):
    num,den=1,1;r=min(r,n-r)
    for i in range(r):num = (num * (n - i)) % p ;den = (den * (i + 1)) % p
    return (num * modinv(den,p)) % p
def isPrime(num) :
    if num<=1:return False
    if num==2 or n==3:return True
    if (num % 2 == 0 or num % 3 == 0) :return False
    m = int(num**0.5)+1
    for i in range(5,m,6):
        if (num % i == 0 or num % (i + 2) == 0) :return False
    return True
def bin_search(s, low, high, val):
    while low <= high:
        mid = low + (high - low) // 2;
        if s[mid] == val:return mid
        elif s[mid] < val:low = mid + 1
        else:high = mid - 1
    return -1
def sumofdigit(num):
    count=0;
    while num : count+=num % 10;num //= 10;
    return count;
def inputmatrix():
    r,c=iia();mat=[0]*r;
    for i in range(r):mat[i]=iia();
    return r,c,mat;
def prefix_sum(n,s):
    for i in range(1,n):s[i]+=s[i-1]
    return s;
def binomial(n, k):
    if 0 <= k <= n:
        ntok = 1;ktok = 1
        for t in range(1, min(k, n - k) + 1):ntok *= n;ktok *= t;n -= 1
        return ntok // ktok
    else:return 0
def divisors(n):
    res = [];
    for i in range(1,ceil(sqrt(n))+1):
        if n%i == 0:
            if i==n//i:res.append(i)
            else:res.append(i);res.append(n//i)
    return res;


MAX = ii1()
factor = [0]*(MAX + 1);
def primefactor():
    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 fun(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__":
    primefactor()
    sum=0
    for i in range(1,MAX):
        a=fun(i)
        sum+=a
    print(sum)

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

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

print(ans)

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

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

print(count)

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

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

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

Solution (Python):
import math

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

n = ii()
s = 0
for i in range(n):
    s += n // (i+1)
    if (n % (i+1)) == 0:
        s = s-1

print(s)

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

tmp = num_divisors_table(n-1)
print(sum(tmp))

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

count = 0

for i in range(N - 1):
    A = i + 1
    B = N / A

    if B == int(B):
        count += B-1
    else:
        count += int(B)

print(int(count))

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())
ans=0
for i in range(1,n):
    tmp=(n-1)//i
    ans+=tmp
print(ans)

Solution (Python):

import sys
import collections

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
    n = I()
    ans = 0
    for c in range(1, n):
        t = list(collections.Counter(prime_factorize(n-c)).values())
        s = 1
        for key in t:
            s *= key+1
        ans += s
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
cnt=0
i=1
while i<n:
    cnt+=(n-1)//i
    i+=1
print(cnt)

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

count = [1]*(N+1)

ans = count[1]
for i in range(2, N):
    k = i
    while k < N:
        count[k] += 1
        k += i

    ans += count[i]

print(ans)

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

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

print(ans)

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

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

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

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

    if c==0:
        cnt+=b-1
    else:
        cnt+=b


print(cnt)

Solution (Python):
import math
N=int(input())
rtN=int(math.sqrt(N))
if rtN**2!=N:
    rtN+=1
    
ans=0
for i in range(1,rtN):
    tmp=N//i if N%i!=0 else N//i-1
    ans+=2*(tmp-i)+1
print(ans)

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

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

Solution (Python):
import math
N = int(input())
ans = 0
for i in range(1, N):
    for j in range(1, math.ceil(N/i)):
        ans += 1
print(ans)

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

ans = 0
for i in range(1, N):
    for j in range(1, N):
        if i * j >= N:
            break
        ans += 1
print(ans)

Solution (Python):

import math
N = int(input())
cnt = 0
for i in range(1,N+1):
    if i*(N//i)==N:
        
        cnt += N//i-1
    else:
        cnt += N//i
        
print(cnt)

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

Solution (Python):
N = int(input())
 
count = 0
for a in range(1, N):
    ans, mod = divmod(N, a)
    if mod == 0:
        count += ans - 1
    else:
        count += ans
 
print(count)

Solution (Python):
N = int(input())
def ans(N):
  count = 0
  for i in range(1,N):
    for j in range(i,int(N/i)+1):
      if N-i*j>=1 and i!=j:
        count += 2
      elif N-i*j>=1 and i==j:
        count += 1
  return count

print(ans(N))

Solution (Python):

def main():
  n = int(input())
  cnt = 0
  same = 0

  for a in range(1, n):
    for b in range(a, n):
      if a * b >= n:
        break

      cnt += 1
      if a == b:
        same += 1

  print((cnt - same) * 2 + same)



main()

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

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

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

half_n = n // 2

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

res = n - half_n - 1
ans += res

print(ans)

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

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())
a=int(1)
ans=int(0)
while a < n:
  ans = ans + (n-1) // a
  a = a + 1
print(ans)

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











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() 
ans = 1



for i in range(2, n):
    cur = calculateNoOFactors(i)
    ans += cur
    
print(ans)

Solution (Python):
def main():
    num = int(input())

    A = 1
    count = 0
    flg = False

    while(True):
        B = 1
        while(True):
            cal = A * B
            if cal < num:
                count += 1
                B += 1
            else:
                if B == 1:
                    flg = True
                break
        if flg:
            break
        A += 1

    print(count)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = n**(0.5)
if n%a==0:
    a = a-1
else:
    pass
a = int(a)

ans = 0
for i in range(1,a+1):
    
    b = n//i
    if n%b==0:
        b=b-1
    else:
        pass
    
    ans += (b-i)*2+1
print(ans)

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

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