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 <stdio.h>
#include <algorithm>
using namespace std;

const long long mod = 1000000007;

long long fpow(long long a, long long p)
{
	long long r = 1;
	while (p){
		if (p & 1) r = r * a % mod;
		a = a * a % mod;
		p /= 2;
	}
	return r;
}

int f(int x)
{
	if (x >= 100000000) return 9;
	if (x >= 10000000) return 8;
	if (x >= 1000000) return 7;
	if (x >= 100000) return 6;
	for (int d=1,p=1;;d++,p*=10){
		if (p <= x && x < p * 10) return d;
	}
	return -1;
}

void test(long long &ans, int l, int m)
{
	if (l <= 8) return;
	ans = (ans + fpow(10,l-1) * 9 - m + 1 + mod) % mod;
}

int main()
{
	int S; scanf ("%d",&S);

	long long ans = 0;

	for (int i=1,j=1,s=0;i<100000000;i++){
		while (s < S) s += f(j++);
		if (s == S) ans = (ans + 1) % mod;
		s -= f(i);
	}

	for (int i=1;i*i<=S;i++) if (S % i == 0){
		test(ans,i,S/i);
		if (S != i * i) test(ans,S/i,i);
	}

	for (int s=9;s<=S/2;s++){
		long long low = (S+1+s)/(s+1);
		long long upp = (S-1)/s;
		if (low <= upp) ans = (ans + upp - low + 1) % mod;
	}

	printf ("%lld\n",ans);

	return 0;
}