Problem: For a positive integer n, let us define f(n) as the number of digits in base 10.

You are given an integer S. Count the number of the pairs of positive integers (l, r) (l \leq r) such that f(l) + f(l + 1) + ... + f(r) = S, and find the count modulo 10^9 + 7.

Constraints

* 1 \leq S \leq 10^8

Input

Input is given from Standard Input in the following format:


S


Output

Print the answer.

Examples

Input

1


Output

9


Input

2


Output

98


Input

123


Output

460191684


Input

36018


Output

966522825


Input

1000


Output

184984484

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
const int oo = 1e9;
const int MOD = 1000000007;
const int N = 100010;
#define x first
#define y second
#define pb push_back
#define mp make_pair

int S;
int f(int n){
	int cnt = 0;
	while(n){
		n/=10;
		cnt++;
	}
	return cnt;
}
ll fastPower(ll a , ll b){
	if(!b)return 1ll;
	ll re = fastPower(a,b/2);
	re = (re*re)%MOD;
	if(b&1)return (re*a)%MOD;
	return re;
}
ll SH(ll t){
	return (fastPower(10,t)-fastPower(10,t-1)+MOD)%MOD;
}
ll an = 0;
vector<int> dv;
int main() {
	cin >> S;
	int idx = 1;
	int sum = 0;
	for(int i = 1; i < 10000000;++i){
		if(idx < i)
			sum = 0,idx = i;
		while(sum+f(idx)<=S){
			sum += f(idx);
			idx++;
		}
		if(sum == S)an++;
		sum -= f(i);
	}
	an = (an +(S/8))%MOD;
	for(int i = 1 ; i * i <= S ; ++i){
		if(S%i==0){
			dv.pb(i);
			if(S/i != i)
				dv.pb(S/i);
		}
	}
	sort(dv.begin(),dv.end());
	dv.resize(unique(dv.begin(),dv.end())-dv.begin());
	for (int i = 0; i < dv.size(); ++i){
		if(dv[i] >= 8  && S%dv[i]==0){
			an = (an + SH(dv[i])-S/dv[i]+MOD)%MOD;
		}
	}
	cout << an << endl;
	return 0;
}