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>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int dc(int v){
	int cnt=0;
	while(v>0){
		v/=10;
		cnt++;
	}
	return cnt;
}

ll extgcd(ll a,ll b,ll& x,ll& y){
	ll d=a;
	if(b!=0LL){
		d=extgcd(b,a%b,y,x);
		y-=(a/b)*x;
	}else{
		x=1;
		y=0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
	ll x,y;
	extgcd(a,m,x,y);
	return (m+x%m)%m;
}

int main(void){
	int s;
	scanf("%d",&s);
	int l=1,r=0;
	int sum=0;
	ll ans=0;
	while(1){
		while(sum<s){
			r++;
			sum+=dc(r);
		}
		if(dc(r)==dc(l))break;
		if(sum==s)ans++;
		sum-=dc(l);
		l++;
	}
	ll ten_pow=1;
	for(int i=1;i<dc(l);i++){
		ten_pow=ten_pow*10LL%MOD;
	}
	for(int i=dc(l);i<=s;i++){
		ll diff=s%i;
		if(diff==0){
			ll need=s/i;
			ans+=(ll)ten_pow*9LL-need+1LL;
			ans+=MOD;
			ans%=MOD;
		}
		ten_pow=ten_pow*10LL%MOD;
		if(diff==0)diff=i;
		//printf("%d s-%lld\n",i,ans);
		if(diff*(i+1)>=s)continue;
		ll st=(s-(diff)*(i+1))/i;
		ans+=(st-1LL)/(i+1LL)+1LL;
		ans%=MOD;
		//printf("%d a-%lld\n",i,ans);
	}
	printf("%lld\n",ans);
	return 0;
}