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 in C++ (GCC 9.2.1) (judge verdict: Accepted)

/*Author : Yuvraj Singh
 * Patience is Power
 * 
 * */
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define mod 1000000007
#define ar array
ll power(ll x,ll y) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2); 
    if (y%2 == 0) 
        return ((temp%mod)*(temp%mod))%mod; 
    else
        return ((x%mod)*(temp%mod)*(temp%mod))%mod; 
}

int gcd(int x,int y){
	return y==0?x:gcd(y,x%y);
}


bool cmp(pair<int,int>a,pair<int,int>b){
	return a.second<b.second;
}




void solve(){
	ll n; cin>>n;
	ll res=0;
	ll j=1;
	while((n-1)/j){
		res += (n-1)/j;
		j++;
	}
	cout<<res;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	
	//int t; cin>>t;
	//while(t--)
		solve();
    return 0;
}