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>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include<iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<deque>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

using namespace std;

#define DBG cerr << '!' << endl;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)
#define MOD 1000000007

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

int main()
{
	int s;cin >> s;
	
	ll ans = 0;
	int cou = 1;
	int tc = 1,tnxt = 10,tp = 1;
	int uc = 1,unxt = 10,up = 1;
	
	if(cou == s)
	{
		ans++;
	}

		
	while(uc < 9999999)
	{
		while(cou < s)
		{
			tc++;
			if(tc == tnxt)
			{
				tnxt *= 10;
				tp++;
			}
			cou += tp;
			if(cou == s)
			{
				ans++;
			}
		}
		
		while(cou >= s && uc < 9999999)
		{
			cou -= up;
			uc++;
			if(uc == unxt)
			{
				unxt *= 10;
				up++;
			}
			if(cou == s)
			{
				ans++;
			}
		}
	}
	//cout << ans << endl;
	for(int i = 1;i <= s/8;i++)
	{
		if(s % i == 0)
		{
			int tmp = s / i;
			ll num1 = 1;
			ll num2 = 1;
			REP(j,tmp-1)num2 = (num2 * 10)%MOD;
			num1 = num2*10%MOD;
			num1 = (num1 - num2 + MOD ) % MOD;
			num1 = (num1 - i + MOD ) % MOD;
			ans = (ans + num1)%MOD;
		}
		ans = (ans + 1) % MOD;
	}
	
	cout << ans << endl;
	
	return 0;
}