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:
// slow 100
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll M = 1e9+7;
const int E = 2.7e7;
int bo[E];
int main() {
	ll n;
	cin >> n;
	ll l = 1,r = 1;
	ll so = 0;
	bo[0] = 0;
	for(int i=1;i<E;i++) {
		bo[i] = bo[i/10]+1;
	}
	ll res = 0;
	for(;l<10000000;l++) {
		while(so < n) {so += bo[r];r++;
		}
		if(so == n) {res++;}
		so -= bo[l];
	}
	ll pot = 9e7;
	for(ll i=8;i<=n;i++) {
		ll se = (n/i) - n%i;
		if(!(n%i)) {
			res += pot-(n/i)+1;
			se -= i+1;
		}
		if(se > 0) {
			res += (se+i)/(i+1);
		}
		pot = pot*10%M;
	}
	res = ((res%M)+M)%M;
	cout << res << '\n';
}