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<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<queue>
#include<bitset>
#include<map>
using namespace std;
template<typename __T>
inline void read(__T &x)
{
    x=0;
    int f=1;char c=getchar();
    while(!isdigit(c)){if(c=='-')	f=-1;c=getchar();}
    while(isdigit(c))	{x=x*10+c-'0';c=getchar();}
    x*=f;
}
const int mod=1000000007;
long long qpow(long long a,long long b)
{
	long long ans=1;
	while(b)
	{
		if(b&1)	ans=ans*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return ans;
}
int dig[30000005];
int n;
int main()
{
	int las=1;
	for(int i=1;i<=8;i++)
	{
		int mx=min(las*10,30000000);
		for(int j=las;j<mx;j++)
			dig[j]=i;
		las*=10;
	}
	for(int i=1;i<=29999999;i++)
		dig[i]+=dig[i-1];
	read(n);
	long long ans=0;
	int r=0;
	for(int i=1;i<10000000;i++)
	{
		while(dig[r]-dig[i-1]<n)	r++;
		if(dig[r]==dig[i-1]+n)	ans++;
	}
	int mxx=n/8;
	ans+=mxx;
	for(int i=1;i<=mxx;i++)
		if(n%i==0)
		{
			int nn=n/i;
			long long sb=9*qpow(10,nn-1)%mod;
			ans+=sb-i;
			ans=(ans+mod)%mod;
		}
	ans=(ans+mod)%mod;
	cout<<ans<<endl;
	return 0;
}