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;

long long f[25000001];
long long MOD=1000000007;

long long Power(long long a, long long k)
{
    long long R=1, ss=a, t=1;
    while (k > 0)
    {
        if (k % (2*t) != 0)
        {
            k -= t;
            R *= ss;
            R %= MOD;
        }
        t *= 2;
        ss *= ss;
        ss %= MOD;
    }
    return R;
}

int main()
{
    ios::sync_with_stdio(false);
    long long r=0, K=0, S, s=0, l, d;
    cin >> S;
    long long I=floor(S/8);
    for (long long i = 1; i <= 25000000; i++)
    {
        d = log10(i) + 1;
        f[i] = d;
    }
    for (int i = 1; i < 10000000; i++)
    {
        while (s < S)
        {
            r++;
            s += f[r];
        }
        if (s == S)
        {
            K++;
        }
        s -= f[i];
    }
    K += I;
    for (int i = 1; i <= I; i++)
    {
        if (S % i == 0)
        {
            d = S / i;
            long long p = Power(10, d) - Power(10, d-1) - S/d;
            while (p < 0)
            {
                p += MOD;
            }
            K += p;
            K %= MOD;
        }
    }
    cout << K;
    return 0;
}