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<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#define LL long long
using namespace std;
const LL mod=1e9+7;
LL n,r=2,t1=10,num1=1,pre[15],ans=0;
LL t2=10,num2=1,cnt=1;
LL pow(LL a,LL b)
{
	LL ans=1;
	while(b)
	{
		if(b&1) ans=ans*a%mod;
		a=a*a%mod;b>>=1;
	}
	return ans;
}
void check(LL len)
{
	if(len<num1) return;
	LL num=n/len,tot=9*pow(10,len-1)%mod;
	(ans+=(tot-num+1)%mod)%=mod;
	//printf("%lld %lld %lld\n",len,tot,num);
}
LL down(LL a,LL b) {return a%b==0?a/b-1:a/b;}
LL up(LL a,LL b) {return a/b+1;}
int main()
{
	scanf("%lld",&n);
	pre[0]=1;for(LL i=1;i<=8;i++) pre[i]=pre[i-1]*10;
	if(n>9)
	{
		for(LL i=1;;i++)
		{
			if(i==t1)
			{
				t1*=10,num1++;
				if(num1*pre[num1-1]*9>=n) break;
			}
			while(cnt<n)
			{
				if(cnt+num2>n) break;
				cnt+=num2;
				r++;if(r==t2) t2*=10,num2++;
			}
			if(cnt==n) (ans+=1)%=mod;
			cnt-=num1;
			//printf("%lld %lld %lld %lld\n",i,r,cnt,ans);
		}
	}
	//printf("1:%lld %lld %lld\n",t1,num1,ans);
	for(LL i=1;i*i<=n;i++)
	{
		if(n%i==0)
		{
			check(i);
			if(i*i!=n) check(n/i);
		}
	}
	//printf("2:%lld\n",ans);
	for(LL i=num1;i<=n/2;i++)
	{
		LL R=down(n,i),L=up(n,i+1);
		if(L<=R) (ans+=(R-L+1))%=mod;
		//printf("%lld %lld\n",i,ans);
	}
	printf("%lld",(ans+mod)%mod);
}