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<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a),i##_end=(b);i<=i##_end;++i)
#define For(i,a,b) for(int i=(a),i##_end=(b);i<i##_end;++i)
#define per(i,a,b) for(int i=(b),i##_st=(a);i>=i##_st;--i)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define dbg(x) cerr<<#x" = "<<x<<endl
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define Es(x,i) for(Edge *i=G[x];i;i=i->nxt)
typedef long long ll;
typedef pair<int,int> pii;
const int inf=~0u>>1,MOD=1e9+7;
inline int rd() {
    int x,c,f=1;while(!isdigit(c=getchar()))f=c!='-';x=c-'0';
    while(isdigit(c=getchar()))x=x*10+c-'0';return f?x:-x;
}
const int N=10000000;
int f[N];
inline int pw(int n,int m){
	int r=1;
	for(;m;m>>=1,n=(ll)n*n%MOD)
		if(m&1)r=(ll)r*n%MOD;
	return r;
}
int main(){
#ifdef flukehn
	freopen("test.txt","r",stdin);
#endif 
	For(i,1,N)f[i]=f[i/10]+1;
	For(i,1,N)f[i]+=f[i-1];
	int l=0,n=rd();
	ll ans=0;
	For(i,1,N){
		while(f[i]-f[l]>n)++l;
		ans+=(f[i]-f[l]==n);
		if(f[N-1]-f[i-1]<n){
			int t=n-f[N-1]+f[i-1];
			if(!(t&7))++ans;
		}
	}
//	cerr<<ans<<endl;
	rep(i,1,n/8){
		if(n%i==0){
			int t=n/i;
			ll tmp=pw(10,t)-pw(10,t-1);
			ans+=tmp-i+1;
		}else{
			++ans;
		}
	}
	ans=(ans%MOD+MOD)%MOD;
	cout<<ans<<endl;
}