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 math
N = int(input())




def make_prime_list_2(num):
    if num < 2:
        return []

    
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]
  
primes = make_prime_list_2(1000)

def num_primes(n):
  wk = n
  res = 1
  for p in primes:
    if p*p > wk:
      break
    cnt = 0
    while wk % p == 0:
      wk = wk // p
      cnt += 1
    res = res * (cnt+1)
  if wk >= 2:
    res *= 2
  return res

dp = [0] * (N+1)
dp[1] = 0
dp[2] = 1

for i in range(2,N):
  dp[i+1] = dp[i] + num_primes(i)
  
print(dp[N])

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

print(sum((N-1) // i for i in range(1, N)))

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

Solution (Python):
from collections import Counter


n = int(input())

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

print((ans))

Solution (Python):
from sys import setrecursionlimit
from collections import Counter
from collections import defaultdict
from collections import deque
from heapq import heapify
from heapq import heappop
from heapq import heappush
from time import time
setrecursionlimit(10**9)
mod=10**9+7
inf=10**18

n=int(input())

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

print(cnt)

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

count = 0
for a in range(1,N+1):
  for b in range(a,N//a + 1):
    c = N - a * b
    if c == 0:
      continue
    else:
      if a != b:
        count += 2
      else:
        count += 1
print(count)

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

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

res = 0

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

print(res)

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

ans = 0
for i in range(1, n):
    d, m = divmod(n, i)
    if m == 0:
        d -= 1
    ans += d
print(ans)

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

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

Solution (Python):
def main():
    n = int(input())
    d = [0 for i in range(n+1)]
    for i in range(1,int(n**0.5)+1):
        for j in range(i,n//i+1):
            if j==i:
                d[i*j]+=1
            else:
                d[i*j]+=2
    ans = 0
    for i in range(n):
        ans += d[i]
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):

import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1  
MOD = 10 ** 9 + 7


def debug(*x):
    print(*x, file=sys.stderr)


def solve(N):
    ret = N - 1
    for i in range(2, N + 1):
        ret += (N - 1) // i
    return ret


def main():
    
    N = int(input())
    print(solve(N))



T1 = """
3
"""
TEST_T1 = """
>>> as_input(T1)
>>> main()
3
"""

T2 = """
100
"""
TEST_T2 = """
>>> as_input(T2)
>>> main()
473
"""

T3 = """
1000000
"""
TEST_T3 = """
>>> as_input(T3)
>>> main()
13969985
"""


def _test():
    import doctest
    doctest.testmod()
    g = globals()
    for k in sorted(g):
        if k.startswith("TEST_"):
            doctest.run_docstring_examples(g[k], g, name=k)


def as_input(s):
    "use in test, use given string as input file"
    import io
    f = io.StringIO(s.strip())
    g = globals()
    g["input"] = lambda: bytes(f.readline(), "ascii")
    g["read"] = lambda: bytes(f.read(), "ascii")


input = sys.stdin.buffer.readline
read = sys.stdin.buffer.read

if sys.argv[-1] == "-t":
    print("testing")
    _test()
    sys.exit()

main()

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

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

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

print(ans)

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

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

print(x)

Solution (Python):



import collections
import sys
import copy
import re
import math


def I(): return int(sys.stdin.readline().rstrip())


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


def main():
    N = I()

    ans = N-1

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

    print(ans)


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):

a = int(input())
cnt = 0

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

print(cnt)

Solution (Python):
import math
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,10**6):
    for j in range(1,10**6):
        k = n-i*j
        if k > 0:
            ans += 1
        else:
            break
print(ans)

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

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

print(ans)

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

s = 0
for k in range( 1, n ):
    s = s + ( ( n - 1 ) // k )

print( s )

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

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

N = int(input().rstrip('\n'))
res = 0
for a in range(1,N):
  if N%a == 0:
    res += N//a-1
  else:
    res += N//a
print(res)

Solution (Python):
import math
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())
table = num_divisors_table(N)

res = 0

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

print(res)

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())
a = num_divisors_table(n-1)

ans = 0
for i in a:
    
    ans += i

print(ans)

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

Solution (Python):
import sys
from sys import exit
from collections import deque
from copy import deepcopy
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def powmod(n,i,mod=MOD):
    return pow(n,mod-1+i,mod) if i<0 else pow(n,i,mod)
def div2(x):
    return x.bit_length()
def div10(x):
    return len(str(x))-(x==0)
def intput():
    return int(input())
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x,d=1):
        self.setdefault(x,0)
        self[x] += d
    def list(self):
        l = []
        for k in self:
            l.extend([k]*self[k])
        return l
class comb():
    def __init__(self, n, mod=None):
        self.l = [1]
        self.n = n
        self.mod = mod
    def get(self,k):
        l,n,mod = self.l, self.n, self.mod
        if k<0 or n<k:
            return 0
        k = n-k if k>n//2 else k
        while len(l)<=k:
            i = len(l)
            l.append(l[i-1]*(n+1-i)//i if mod==None else (l[i-1]*(n+1-i)*powmod(i,-1,mod))%mod)
        return l[k]
def pf(x,mode='counter'):
    C = counter()
    p = 2
    while x>1:
        k = 0
        while x%p==0:
            x //= p
            k += 1
        if k>0:
            C.add(p,k)
        p = p+2-(p==2) if p*p<x else x
    if mode=='counter':
        return C
    S = set([1])
    for k in C:
        T = deepcopy(S)
        for x in T:
            for i in range(1,C[k]+1):
                S.add(x*(k**i))
    if mode=='set':
        return S
    if mode=='list':
        return sorted(list(S))



N=intput()
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):
    b_max = (N - 1) // a

    if a * b_max >= N:
        continue

    ans += b_max


print(ans)

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):
def main():
    N = int(input())

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

        total = total + bmax
    print(total)


main()

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

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

class ABC(object):

    def __init__(self):
        pass


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

        n_c = n - 1

        ans = 0
        for i_a in range(1, n_c+1):
            max_b = n_c // i_a
            ans += max_b

        print(ans)
        return


if __name__ == "__main__":
    obj = ABC()
    obj.main()
    sys.exit(0)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()

    ans = 0
    for A in range(1,N+1):
        for B in range(1,N+1):
            if A*B > N:
                break

            C = N - A*B
            if C > 0:
                ans += 1
    
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):

import math
import collections
import bisect
from collections import deque
from copy import copy, deepcopy
import time

import numpy as np
import numba
from numba import njit, b1, i4, i8, f8
from numba import jit


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

if __name__ == '__main__':
    main()

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

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


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

Sum = 0
hoge = num_divisors_table(N-1)
Sum = sum(hoge)

print(Sum)

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

ans = 0
for a in range(1, N):
    for b in range(a, N):
        
        if a * b < N:
            ans += 1
            if a != b:
                ans += 1
        else:
            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 math
N = int(input())
ans=0
for i in range(1,N+1,1):
  ans += math.ceil(N/i)-1
  
print(ans)

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

main()

Solution (Python):
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))


    N = NI()
    ans = (N-1) * 2 - 1
    for i in range(2,N//2+1):
        j = 2
        while i * j < N:
            ans += 1
            j += 1
    print(ans)


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

ans = 0
for a in range(1, N+1):
    x = N // a

    if N % a == 0:
        ans += x - 1
    else:
        ans += x

print(ans)

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

A = 1
count = 0
while A < N:
	B = 1
	while A * B < N:
		B += 1
		count += 1
	A += 1
print(count)

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

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

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

if __name__ == "__main__":
    main()

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 i in range(1, N):
    e = (N-1)//i
    ans += max(0, (e-i+1)*2 -1)
print(ans)

Solution (Python):

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

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


if __name__ == '__main__':
    main()

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

ans = 0

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

print(ans)

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

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

if __name__ == '__main__':
    solve()

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

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

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

res = 0
for a in range(1, n):
    max_b = int((n-1)/a)
    res += max_b

print(res)

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

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

Solution (Python):
from itertools import groupby
class Combination:
    def __init__(self, n, mod):
        self.n = n
        self.mod = mod
        self.fac = [1 for i in range(self.n + 1)]
        self.finv = [1 for i in range(self.n + 1)]
        for i in range(2, self.n+1):
            self.fac[i] = (self.fac[i - 1] * i) % self.mod
            self.finv[i] = (self.finv[i - 1] * pow(i, -1, self.mod)) % self.mod

    def comb(self, n, m):
        return self.fac[n] * (self.finv[n - m] * self.finv[m] % self.mod) % self.mod
        
def iparse():
    return list(map(int, input().split()))





def runLengthEncode(S: str):
    grouped = groupby(S)
    res = []
    for k, v in grouped:
        res.append((k, str(len(list(v)))))
    return res


if __name__ == "__main__":
    n = int(input())
    i = 1
    ans = 0
    for i in range(1, n - 1):
        if n % i == 0:
            ans -= 1
        ans += n // i
    print(ans+1)

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

    numDivs = [0] * (N+1)
    for div in range(1, N+1):
        for x in range(div, N+1, div):
            numDivs[x] += 1

    ans = 0
    for C in range(1, N+1):
        ans += numDivs[N-C]

    print(ans)


solve()

Solution (Python):

n = int(input())

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

Solution (Python):
from sys import stdin
def I():
    return stdin.readline().rstrip()
def MI():
    return map(int,stdin.readline().rstrip().split())
def LI():
    return list(map(int,stdin.readline().rstrip().split()))

n=int(I())
cnt=0
for a in range(1,n):
    for b in range(1,n):
        if a*b>=n:
            break
        cnt+=1
print(cnt)

Solution (Python):
N = int(input())
cnt = 0
for A in range(1,N+1):
    for B in range(1,N//A+1):
        C = N-A*B
        if C>0:
            cnt += 1
print(cnt)

Solution (Python):
n = int(input())
def f(x):
    if n % x == 0:
        return n//x - 1
    else:
        return n//x
s = 0
for a in range(1, n):
    s += f(a)
print(s)

Solution (Python):


import re
import math
from collections import defaultdict,deque,Counter
from fractions import Fraction
import bisect
import itertools
from itertools import accumulate
from copy import deepcopy

import heapq
import random
import time
import os
import sys
from functools import lru_cache,reduce
readline=sys.stdin.readline
sys.setrecursionlimit(100000)
alp="abcdefghijklmnopqrstuvwxyz"
numbers="0123456789"
mod=int(10**9+7)
inf=int(10**19)
class Set():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(bool)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        if not self.find(x):
            heapq.heappush(self.heap,x)
            self.dic[x]=True
            self.size+=1

    def remove(self,x):
        if self.find(x):
            self.dic[x]=False
            self.size-=1

    def find(self,x):
        return self.dic[x]
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==False:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class multiset():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(int)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        heapq.heappush(self.heap,x)
        self.dic[x]+=1
        self.size+=1

    def remove(self,x):
        if self.dic[x]>0:
            self.dic[x]-=1
            self.size-=1
    
    def count(self,x):
        return self.dic[x]

    def find(self,x):
        return self.dic[x]>0
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==0:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class Edge():
    def __init__(self,x,y,val=1):
        self.x=x
        self.y=y
        self.val=val
class Point():
    def __init__(self,y,x):
        self.x=x
        self.y=y
class unionfind():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):
            self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def yn(b):print("yes" if b else "no")
def Yn(b):print("Yes" if b else "No")
def YN(b):print("YES" if b else "NO")
def ispow(a,b):
    now=b
    while now<a:
        now*=b
    return now==a
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n):
    if n==0:return []
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    ret=[]
    for a in range(n+1):
        if(A[a]):ret.append(a)
    return ret
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(b,t,f):return t if b else f
def factorize(n):
    b = 2
    ret=defaultdict(int)
    while b * b <= n:
        while n % b == 0:
            n //= b
            ret[b]+=1
        b+=1
    if n > 1:ret[n]+=1
    return ret
def inputintlist(row=1): 
    if row==1:
        ret=list(map(int,input().split()))
    else:
        ret=[None]*row
        for a in range(row):
            ret[a]=int(input())
    return ret
def inputfloatlist(row=1): 
    if row==1:
        ret=list(map(float,input().split()))
    else:
        ret=[None]*row
        for a in range(row):
            ret[a]=float(input())
    return ret
def istanchouzouka(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>=a:
            f=False
        prev=a
    return f
def istanchouhigensyou(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>a:
            f=False
        prev=a
    return f
def getallsum(A):
    s=sum(A)
    dp=defaultdict(int)
    dp[0]=1
    for a in range(0,len(A)):
        for b in range(s,-1,-1):
            if b-A[a]>=0:
                dp[b]+=dp[b-A[a]]
    return dp
def yuukoutomukou(edges):
    ret=deepcopy(edges)
    for edge in edges:
        if not edge.x==edge.y:
            ret.append(Edge(edge.y,edge.x,edge.val))
    return ret
def dijkstra(edges,V,start):
    from queue import PriorityQueue
    mincost=[inf]*V
    G=[[] for a in range(V)]
    for edge in edges:
        G[edge.x].append([edge.val,edge.y])
    Q=PriorityQueue()
    Q.put([0,start])
    while not Q.empty():
        nowcost,nowx=Q.get()
        if mincost[nowx]==inf:
            mincost[nowx]=nowcost
            for cost,y in G[nowx]:
                newcost=nowcost+cost
                Q.put([newcost,y])
    return mincost
def warshallfloyd(edges,V):
    mincost=[[inf for b in range(V)] for a in range(V)]
    for a in range(V):mincost[a][a]=0
    for edge in edges:
        mincost[edge.x][edge.y]=min(mincost[edge.x][edge.y],edge.val)
    for k in range(V):
        for s in range(V):
            for t in range(V):
                if mincost[s][k]==inf or mincost[k][t]==inf:continue
                mincost[s][t]=min(mincost[s][t],mincost[s][k]+mincost[k][t])
    return mincost
def bellemanford(edges,V,start):
    mincost=[inf]*V
    mincost[start]=0
    for _ in range(V):
        for edge in edges:
            if mincost[edge.x]==inf:continue
            mincost[edge.y]=min(mincost[edge.y],mincost[edge.x]+edge.val)
    return mincost
def getmd(x1,y1,x2,y2):return abs(x1-x2)+abs(y1-y2)
def geted(x1,y1,x2,y2):return math.sqrt((x1-x2)**2+(y1-y2)**2)
class fordfulkerson():
    def __init__(self,edges,V,s,t):
        self.V=V
        self.used=[False]*V
        self.G=[[] for a in range(V)]
        self.s=s
        self.t=t
        for edge in edges:
            self.G[edge.x].append({"x":edge.x,"y":edge.y,"cap":edge.val,"rev":len(self.G[edge.y])})
            self.G[edge.y].append({"x":edge.y,"y":edge.x,"cap":0,"rev":len(self.G[edge.x])-1})
    def dfs(self,v,t,f=inf):
        if v==t:return f
        self.used[v]=True
        for a in range(len(self.G[v])):
            x=self.G[v][a]["x"]
            y=self.G[v][a]["y"]
            cap=self.G[v][a]["cap"]
            rev=self.G[y][self.G[x][a]["rev"]]
            if self.used[y] or cap==0:continue
            f2=self.dfs(y,t,min(f,cap))
            if f2>0:
                self.G[v][a]["cap"]-=f2
                rev["cap"]+=f2
                return f2
        return 0
    def maxflow(self):
        flow=0
        while True:
            self.used=[False]*V
            zouka=self.dfs(self.s,self.t)
            if zouka==0:break
            flow+=zouka
        return flow
def zipsort(*args):
    ziplist=sorted(zip(*args))
    for a in range(len(args)):
        for b in range(len(ziplist)):
            args[a][b]=ziplist[b][a]
def zipreverse(*args):
    ziplist=list(zip(*args))
    rev=[]
    for a in range(len(ziplist)-1,-1,-1):
        rev.append(ziplist[a])
    for a in range(len(args)):
        for b in range(len(rev)):
            args[a][b]=rev[b][a]

def to10(A):
    ret=0
    for a in range(len(A)-1,-1,-1):
        ret+=X[a]*2**(N-1-a)
    return ret

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

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

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

print(sigma)

Solution (Python):
from collections import Counter
N = int(input())
ans = 0
C = Counter([])
for a in range(1, N + 1):
    for b in range(1, N + 1):
        if a * b >= N:
            break
        ans += 1
        if a == b:
            C[a * b] += 1

for v in C.values():
    if v >= 2:
        ans -= (v - 1)
print(ans)

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]
def SR(n):
    return [S() for _ in range(n)]
def LSR(n):
    return [LS() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    f = [1]*n
    f[1] = 1
    for i in range(1,n):
        j = 2*i
        fi = f[i]
        while j < n:
            f[j] += 1
            j += i
    print(sum(f)-1)
    return


if __name__ == "__main__":
    solve()

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

ans = 0

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

print(ans)

Solution (Python):




import sys
input = sys.stdin.readline



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

    res = 0

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

    print(res)



main()

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

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

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

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

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

n, t = int(si()), 0
for i in range(1, n):
    q = n//i
    if not n % i:
        q -= 1
    t += q
print(t)

Solution (Python):
N = int(input())
ans = 0
M = N-1
for i in range(1, N):
    for j in range(1, N):
        if i*j <= M:
            ans += 1
        else:
            break
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())
ans = 0
for i in range(1, n):
    ans += (n - 1) // i
print(ans)

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

print(count)

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

n=II()
count=0
for a in range(1,n):
    m=int(n/a)+1
    for b in range(1,m):
        c=n-a*b
        if 1<=c:
            count+=1
print(count)

Solution (Python):
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

INF = 10**18
eps = 10**-7

n=int(input())
cnt=0
for i in range(1,n+1):
  for j in range(i+1,n+1):
    if i*j<n:
      cnt+=2
    else:
      break
      
for j in range(1,n+1):
  if j*j<n:
    cnt+=1

print(cnt)

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

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
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())
def main():


    n = I()
    ans = 0

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

    print(ans)

main()

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())
r=0
for a in range(1,n):
     if a>n:break
     for b in range(1,n):
          if a*b>=n:break
          else:r+=1
print(r)

Solution (Python):
n=int(input())
print(sum(~-n//i for i in range(1,n)))

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

while n >= c:
    while b <= (n-c):
        ans += (n-c)//b
        b += 1
    c += 1

print(ans)

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




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


print(ans)