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>
#define maxn 23333333
#define mod 1000000007
using namespace std;
int f[maxn];

long long Pow (long long x, long long p) {
	long long ret = 1;
	for(; p; p >>= 1, x = x * x % mod) if(p & 1) ret = ret * x % mod; 
	return ret;
}

int main() {
	for(int i = 1; i < maxn; ++i) f[i] = f[i / 10] + 1;
	int S;
	scanf("%d", &S);
	long long ans = S >> 3;
	{
		int l, r, s, li = maxn;
		if(S % 8 == 0) li = 9999999 + S / 8;
		for(l = r = 1, s = f[r]; r < li; s += f[++r]) {
			while(s > S) s -= f[l++];
			if(s == S) ++ans;
		}
	}
//	cerr << ans << endl;
	for(int i = 1; i <= (S >> 3); ++i) {
		if(S % i == 0) {
			ans += 9 * Pow(10, S / i - 1) + mod - i;
		}
	}
	ans %= mod;
	printf("%lld", ans);
	return 0;
}