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, os.path
import math
from collections import Counter
if(os.path.exists('input.txt')):
    sys.stdin = open("input.txt","r")
    sys.stdout = open("output.txt","w")
 
 
 
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())
temp = n
c = 1
count = 0
while(temp-c > 0):
    w = temp-c
    count += calculateNoOFactors(w)
    c += 1
print(count)

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

r=0
t=n
for i in range(1,n):
    p=((n-1)//i)



    s+=p

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

table = num_divisors_table(1000000)




res = 0
for i in range(1, N):
  res += table[i]

print(res)

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

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

Solution (Python):
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    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)))

if __name__ == "__main__":
    main()

Solution (Python):


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


def answer():
    n = input_int()

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


answer()

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

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


print(count)

Solution (Python):
n = int(input())
cnt = 0
for a in range(1, n):
    for b in range(1, n):
        if a * b < n:
            cnt += 1
        else:
            break
print(cnt)

Solution (Python):
import math

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

Solution (Python):
N = int(input())
ans=0
c=0
for a in range(1,1001):
    c=N-a*a
    if c>=1:
        ans+=1
ans1=0
for a in range(1,1000001):
    for b in range(a+1,int(N/a)+1):
        c=N-a*b
        if c>=1:
            ans1+=1
print(ans+ans1*2)

Solution (Python):
import sys

N = int(sys.stdin.readline())

ans = 0
for i in range(1, int(N**0.5) + 1):
    
    a = i
    b_max = N // i
    for b in range(a, b_max + 1):
        c = N - a * b
        if c > 0:
            if a == b:
                ans += 1
            else:
                ans += 2

print(ans)

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

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007



def main():
	n = int(input())
	
	
	ret = 0
	for i in range(1, n):
		ret += (n-1)//i
	return ret
		
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

counter = 0
for i in range(1,N):
    for j in range(1,min(i, int((N-1)/i))+1):
      if i == j:
        counter += 1
      else:
        counter += 2

print(counter)

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

count = 0
count2 = 0
ABC = [0]*3

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


print(count)

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

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


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

Solution (Python):
import numpy as np
N = int(input())
A = np.arange(1, N, 1)
ans = 0
for a in A:
    ans += int((N-1)/a)
print(ans)

Solution (Python):
import math
N = int(input())
z = 0
for a in range(N):
    for b in range(min(a,math.floor(N/(a+1)))):
        if N - (a+1)*(b+1) > 0:
            z = z+2
        else:
            pass
    if N - (a+1)*(a+1) > 0:
        z = z+1
    else:
        pass
print(z)

Solution (Python):

'''
Created on 2020/09/19

@author: harurun
'''

def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  N=int(pin())
  ans=0
  for i in range(1,N):
    for j in range(1,N+1):
      if N-i*j>0:ans+=1
      else:break
  print(ans)
  return
main()

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

Solution (Python):
import math

N = int(input())

count = 0

for i in range(math.ceil(math.sqrt(N)))[1:]:
    if N % i == 0:
        tmp = N // i - 1
    else:
        tmp = N // i 
    count += (tmp - i) * 2 + 1
print(count)

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

for i in range(1,10**6):
  for j in range(i,10**6//i+1):
    if N > i*j:
      if i==j:
        ans += 1
      else:
        ans += 2

print(ans)

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

Solution (Python):

import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
cnt = 0
for a in range(1,N+1):
    cnt += N // a
    if N % a == 0:
        cnt -= 1
print(cnt)

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

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

Solution (Python):
def sieve(n):
    """
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    """
    from math import sqrt
    M = 10**6
    p = [1]*(M+1)
    p[0] = p[1] = 0
    P = []
    for x in range(2, int(sqrt(M))+1):
        if p[x]:
            P.append(x)
            for y in range(x*x, M+1, x):
                p[y] = 0
    return P

def isPrime(n,p):
    cnt = 0
    while n%p==0:
        n //= p
        cnt += 1
    return cnt,n

N = int(input())
P = sieve(N)
ans = 0
d = dict()
for n in range(1,N):
    flg = 1
    m = n
    d[m] = 0
    fac = 1
    for p in P:
        if n!=m and n in d:
            d[m] = d[n]*fac
            flg = 0
            break
        elif n%p == 0:
            l,n = isPrime(n,p)
            fac *= l+1
            d[m//n] = fac
        if p > n:
            break

    if flg:
        if n > 1:
            fac += 1
        d[m] = fac
    ans += d[m]
print(ans)

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


cnt=0
if k>6:
    for i in range(7,k):
        for j in range(1,k):
            
                
            if i*j<k:
                cnt+=1
            else:
                break
print(cnt+k-1+((k-1)//2)+((k-1)//3)+((k-1)//4)+((k-1)//5)+((k-1)//6))

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

Solution (Python):
n = int(input())
a = 2
ans = 0
 
while a < n/2:
    b = 2
    while a * b < n:
        ans += 1
        b += 1
    a += 1
 
print(ans+2*(n-2)+1)

Solution (Python):
import sys
import math
N=int(input())
n=math.ceil(N**0.5)
s=0
t=0
for a in range(1,n+1):
    if a*a<N:
        t=t+1
        
        for b in range(a+1,N//a+1):
            if a*b<N:
                s=s+1
            
    else:
        print(t+2*s)
        sys.exit()

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

Solution (Python):
N = int(input())
a = 1
c = N-1
count = 0
b = 1
while b>0 :
    b = (N-1)//a
    count += b
    a += 1
print(count)

Solution (Python):
import math
N = int(input())
count = 0
for i in range(1, N):
    if i == 1:
        count += N - 1
        continue
    if N % i == 0:
        count += N / i -1
    elif N % i >= 1:
        count += math.floor(N / i)
print(int(count))

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

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

Solution (Python):
n = int(input())
cnt = 0
for a in range(1, int(n**0.5)+1):
    for b in range(a, n):
        if n > a*b:
            if a == b:
                cnt += 1
            else:
                cnt += 2
        else:
            break
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):
n = int(input())
cnt =[0]*(n+1)
ans = 0

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

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

Solution (Python):
counter = 0

N = int(input())
counter += (N-2)*2+1
limit = 0
for i in range(1000):
    if (i+1)**2 >=1000000:
        limit = i

if N >= 100:
    if N%2 == 0:
        counter += (N//2-3)*2+1
    else:
        counter += (N//2-2)*2+1

    for i in range(limit):
        for j in range(N//3):
            if (i+3) * (i+3+j) < N:
                if j == 0:
                    counter += 1
                else:
                    counter += 2
            else:
                break
else:
    for i in range(limit):
        for j in range(N // 2):
            if (i + 2) * (i + 2 + j) < N:
                if j == 0:
                    counter += 1
                else:
                    counter += 2
            else:
                break
print(counter)

Solution (Python):
import math as mt
from collections import defaultdict
  
MAXN = 10**6
  
spf = [0 for i in range(MAXN)] 
  
def sieve(): 
    spf[1] = 1
    for i in range(2, MAXN): 
        spf[i] = i 
    for i in range(4, MAXN, 2): 
        spf[i] = 2
  
    for i in range(3, mt.ceil(mt.sqrt(MAXN))): 
        if (spf[i] == i): 
            for j in range(i * i, MAXN, i):  
                if (spf[j] == j): 
                    spf[j] = i 
  



def getFactorization(x): 
    d = defaultdict(int)
    while (x != 1): 
        
        d[spf[x]] += 1 
        x = x // spf[x] 
    
    ans = 1
    for i in d:
        ans *= (d[i]+1)
    return ans
sieve()

n = int(input())
ans = 0
for i in range(1, n):
    ans += getFactorization(i)
print(ans)

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

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

for i in range(int(N ** 0.5)):
    a = int((N-1)/(i+1))
    pl = 2*(a-(i+1))+1 
    if pl >= 0:
      res += pl

print(res)

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

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

print(ans)

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

Solution (Python):
N=int(input(''))
a=1
k=0
F=int(N**(1/2))

while a<N:
  if N%a>0:
    b=N//a
    k=k+b
    b=0
  else:
    b=N//a
    k=k+b-1
    b=0
  a=a+1

print(k)

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

print(n)

Solution (Python):
import math

N = int(input())

ans = 0

for a in range(1, N):
    cnt = 0
    for b in range(a, N):
        if a * b < N:
            if a < b:
                cnt += 2
            elif a == b:
                cnt += 1
        else:
            break
    ans += cnt

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())
def num_divisor(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_divisor(n-1)))

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

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

Solution (Python):
import math
n = int(input())
count = 0
for i in range(1, n):
    if (math.floor(n/i) == n/i):
        res = n/i - 1
        if(i == res):
            count += 1
        if(res<= i):
            print(int(count))
            exit()
    else:
        res = math.floor(n/i)
        if(i == res):
            count += 1
        if(res<= i):
            print(int(count))
            exit()
    count = count + (res-i+1)*2 - 1
print(int(count))

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

ans += (n-1-1)*2
print(ans+1)

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


def getNumsOfDivisorsOfEachNumbers(n: int):
    
    if not isinstance(n, int):
        raise("[ERROR] parameter must be integer")
    if n < 0:
        raise("[ERROR] parameter must be not less than 0 (n >= 0)")
    nums = [0] * (n + 1)  
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            nums[j] += 1
    nums.pop(0)
    return nums


l = getNumsOfDivisorsOfEachNumbers(n)

res = 0
for c in l:
    res += c

res -= l[n - 1]

print(res)

Solution (Python):
import numpy as np

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):
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(N-1):
    if N // (i+1) > 0:
        if N % (i+1) > 0:
            ans = ans + N//(i+1)
        else:
            ans = (ans + N//(i+1)) -1

print(ans)

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

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

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

print(count)

Solution (Python):





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;



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

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

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

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

Solution (Python):
import math
N = int(input()) - 1
rNf = math.floor(N**0.5)
ans = 0
for i in range(1, rNf + 1):
  ans += math.floor(N/i)
ans *= 2
ans -= rNf**2
print(ans)

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

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

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

ans = 0

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

    ans += tmp

print(ans)

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

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

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

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

cnt += n // 2
print(cnt)

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

x = 0
A = 1

while A < N:
    y = N // A
    if N % A == 0:
        x -= 1
    x += y
    A += 1
    
print(x)

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

res=0

for i in range(1,ceil(n/2)):
    for j in range(i+1,n):
        if i*j < n:
            res+=1
        else:
            break

if int(n**0.5) == n**0.5:
    print(res*2 + int(n**0.5) - 1)
else:
    print(res*2 + int(n**0.5))

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

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

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

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



import sys
N = int(input())

cnt = 0

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

print(cnt)

Solution (Python):
import math
n=int(input())
c=1+(n-1-1)*2


for i in range(2,n):
    for j in range(2,n):
        if i*j>=n:
            break
        c+=1

print(c)

Solution (Python):
import math

N = int(input())
cnt = 0
maxI = int(math.floor(math.sqrt(N)))

for i in range(1,maxI+1, 1):
  cnt += int(math.floor((N-1)/i)) - i

cnt *= 2

if N == maxI * maxI:
  cnt += maxI + 1
else:
  cnt += maxI

print(cnt)

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

Solution (Python):
import math

def getNumsOfDivisorsOfEachNumbers(n: int):
    c = 0
    
    if not isinstance(n, int):
        raise("[ERROR] parameter must be integer")
    if n < 0:
        raise("[ERROR] parameter must be not less than 0 (n >= 0)")
    nums = [0] * (n + 1) 
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            nums[j] += 1
    nums.pop(0)
    for i in range(len(nums)):
        c+=nums[i]
    return c






N = int(input())





if N == 1:
    print("0")
    exit(0)
elif N == 2:
    print("1")
    exit(0)
c = 0



print(getNumsOfDivisorsOfEachNumbers(N-1))

'''
for i in range(1,N):
    for j in range(1, i + 1):
        if j*j > i:
            break
        if i%j == 0:
            if j*j == i:
                c += 1
            else:
                c += 2
print(c)

'''

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

Solution (Python):
import math
N = int(input())
sqrt = math.ceil(math.sqrt(N))

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

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

total = 0


for i in range(1, N + 1):
    a = N // i
    if N <= a * i:
        a -= 1 
    total += a

print(total)

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

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key
from bisect import bisect_left


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

def bindex(a,x):
    i = bisect_left(a,x)
    if i != len(a) and a[i] == x:
        return i
    return None

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    N = intinput()

    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    

    n = int(sqrt(N))
    cnt = 0
    for i in range(1,n+1):
        a = ceil((N-i*i)/i)
        b = a-1 if a-1 >= 0 else 0
        cnt += a+b
    print(cnt)

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

ct = 0
for i in range(1, N):
    if i * i >= N:
        break
    x = int((N - 1)/i)
    ct += (x - i)*2 + 1
print(ct)

Solution (Python):



n = input()
n = int(n)

c = 0
for i in range(n):
    j = i+1
    k = 1
    while True:
        if j*k<n:
            c = c+1
        else:
            break
        k = k+1

print(c)

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

m=int((n-1)**(1/2))

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

print(cnt)

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

memo = dict()
def prime_factorize(n):
    a = []
    original_n = n
    while n % 2 == 0:
        a.append(2)
        n //= 2
        if n in memo:
            n_ = a + memo[n]
            memo[original_n] = n_
            return n_
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
            if n in memo:
                n_ = a + memo[n]
                memo[original_n] = n_
                return n_
        else:
            f += 2
    if n != 1:
        a.append(n)
    memo.update({original_n: a})
    return a

answer = 0
memo = dict()

import collections
for i in range(n-1):
    num = i+1
    if num == 1:
        answer += 1
        continue

    primes = prime_factorize(num)
    col = collections.Counter(primes)
    temp = 1
    for k, v in col.items():
        temp *= (v+1)

    answer += temp

print(answer)

Solution (Python):
import sys
n = int(sys.stdin.readline().strip())

eroot_n = int(pow(n, 0.5))
res = 0
for num_a in range(1, eroot_n + 1):
    limit_b = int(n / num_a) + 1
    for num_b in range(num_a, limit_b):
        """
        print(num_a)
        print(num_b)
        print('\n')
        """
        if num_a * num_b >= n:
            continue
        if num_a == num_b:
            res = res + 1
        else:
            res = res + 2
print(res)

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

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

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

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

print(sum)

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

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

print(counter)

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

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

output = 0
divisor = num_divisors_table(n-1)

output = sum(divisor)

print(output)

Solution (Python):
import sys, os.path
import math
from collections import Counter
if(os.path.exists('input.txt')):
    sys.stdin = open("input.txt","r")
    sys.stdout = open("output.txt","w")



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())
temp = n
c = 1
count = 0
while(temp-c > 0):
    w = temp-c
    count += calculateNoOFactors(w)
    c += 1
print(count)

Solution (Python):
n=int(input())
x=0
for a in range(1,n):
  for b in range(1,n):
    if a*b<n:
      x+=1
    elif a*b>=n:
      break
print(x)

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

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

Sum = 0
preSum = 0

a = N -1
b = 1

while True:
  c = a // b
  
  
  
  if c < b:
    Sum = preSum * 2 + b - 1
    break
  elif c == b:
    Sum = preSum * 2 + 1 + b - 1
    break
  else:
    preSum += c - 1 - b + 1
    b += 1
  
  

print(Sum)