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<algorithm>
#include<cstring>
#define MN 40000005
using namespace std;
typedef long long ll;
int n,a[MN];
const int mod=1e9+7;
inline void add(ll &x,int y){(x+=y)>=mod?x-=mod:0;}
ll ans;
ll pow(int y){
	ll tmp=1,x=10;
	while(y){
		if(y&1)tmp=tmp*x%mod;
		y>>=1,x=x*x%mod;
	}return tmp;
}
int main(){
	scanf("%d",&n);for(int i=1;i<=4e7;i++)a[i]=a[i/10]+1;int r=1,ss=0;
   	for(int i=1;i<1e7;i++){
   		while(ss<n)ss+=a[r],++r;if(ss==n)add(ans,1);ss-=a[i];
	}
	for(int i=1;i<=n/8;i++){
		if(n%i!=0)add(ans,1);
		else add(ans,((pow(n/i)-pow(n/i-1)-i+1)%mod+mod)%mod);
    }printf("%lld\n",(ans%mod+mod)%mod);
}