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 <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int S, v[10000009], lim = 100000000, mod = 1000000007;
int binpow(int a, int b) {
	int ret = 1;
	while (b) {
		if (b & 1) ret = 1LL * ret * a % mod;
		a = 1LL * a * a % mod;
		b >>= 1;
	}
	return ret;
}
int main() {
	cin >> S;
	for (int i = 1; 10 * i < lim; i++) {
		int b = i;
		while (b > 0) b /= 10, v[i]++;
	}
	int r = 1, s = 0, ret = 0;
	for (int i = 1; i < lim; i++) {
		while (s < S) s += (10 * r < lim ? v[r] : (r < lim ? 8 : 9)), r++;
		if (s == S) ret++;
		s -= (10 * i < lim ? v[i] : 8);
	}
	vector<int> d;
	for (int i = 1; i * i <= S; i++) {
		if (S % i == 0) {
			d.push_back(i);
			if (i * i != S) d.push_back(S / i);
		}
	}
	for (int i : d) {
		if (i <= 8) continue;
		if (S % i == 0) {
			ret = (ret + 9LL * binpow(10, i - 1)) % mod;
			ret = (ret - S / i + 1 + mod) % mod;
		}
	}
	for (int i = 2; 9 * i < S; i++) {
		for (int j = 9 * i; j < S; j += i) {
			if (j > S - i) ret++;
		}
	}
	cout << ret % mod << endl;
	return 0;
}