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 <cstring>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

const ll mod = 1000000007LL;
const ll limit = 10000000LL;

ll S, i, j, p, act, aux;
ll last, sols;

ll poww(ll a, ll b) {
    ll ans = 1;

    while (b > 0) {
        if (b & 1) ans = (ans * a) % mod;
        b >>= 1;
        a = (a * a) % mod;
    }

    return ans;
}

ll cnt(ll x) {
    ll ans = 0;
    while (x > 0) {
        ans++;
        x /= 10;
    }
    last = ans;
    return ans;
}

void check(ll len) {
    if (len > aux) return;

    ll val = S / len;
    ll cnt = poww(10, val) - poww(10, val - 1) + mod;
    sols += cnt - len + 1 + mod;
    sols += mod - 1;
    sols %= mod;
}

int main()
{
  //  freopen("test.in","r",stdin);

    scanf("%lld", &S);

    act = 0;
    while (act + cnt(p + 1) <= S) {
        act += last;
        p++;
    }

    for (i = 1; i < limit; i++) {
        if (act + cnt(p + 1) <= S) {
            act += last;
            p++;
        }

        if (act == S) {
            sols++;

            /*act = 0;
            for (j = i; j <= p; j++) act += cnt(j);
            if (act != S) sols--;*/
        }
        if (act == 0) break;
        act -= cnt(i);
    }

    aux = S / 8;
    sols += aux;

    for (ll d = 1; d * d <= S; d++) {
        if (S % d) continue;
        check(d);
        if (d * d != S) check(S / d);
    }

    printf("%lld", sols);

    return 0;
}