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>
using namespace std;
int n,ans,num[23000001];
int mod=1e9+7;
inline void add(int &x, int y){
    x+=y;
    if(x>=mod) x-=mod;
}
int cheng(long long a,int b){
	long long sum=1;
	for(;b;b>>=1){
		if(b%2==1){
			sum=(sum*a)%mod;
		}
		a=(a*a)%mod;
	}
	return int(sum);
}
int main(){
	cin>>n;
	for(int i=1;i<=23000000;i++)num[i]=num[i/10]+1;
	int j=1,s=0;
	for(int i=1;i<1e7;i++){
		while(s<n){
			s+=num[j];
			j++;
		}
        if(s==n)ans=(ans+1)%mod;
        s-=num[i];
	}
	for(int i=1;i<=n/8;i++){
		if(n%i==0){
			add(ans,((cheng(10,n/i)-cheng(10,n/i-1)-i+1)%mod+mod)%mod);
		}
		else ans=(ans+1)%mod;
	}
	cout<<ans%mod;
}