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>
using namespace std;
const int mod = 1e9 + 7;
int calc(int x){
    if(x <= 9) return 1;
    if(x <= 99) return 2;
    if(x <= 999) return 3;
    if(x <= 9999) return 4;
    if(x <= 99999) return 5;
    if(x <= 999999) return 6;
    if(x <= 9999999) return 7;
    return 8;
}
long long sum[23000005], S;
long long mypow(long long a, long long b){
    long long ans = 1;
    for(; b; b >>= 1) { if(b&1) (ans *= a) %= mod; (a *= a) %= mod; } return ans;
}
int main()
{
    cin>>S;
    for(int i = 1; i <= 23000004; i++){
        sum[i] = sum[i-1] + calc(i);
    }
    int j = 1;
    long long ans = 0;
    for(int i = 1; i <= 23000004; i++){
        while(sum[j] - sum[i-1] < S) j++;
        if(calc(i) > 7) break;
        if(sum[j] - sum[i-1] == S) ans++;
    }
    (ans += S/8) %= mod;
    for(int i = 1; i <= S/8; i++){
        if(S % i == 0){
            int x = S/i;
            ( (((ans += 9*mypow(10, x-1)) -= i) %= mod) += mod) %= mod;
        }
    }
    cout<<ans<<endl;
    return 0;
}