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>
#define MOD 1000000007

using namespace std;

int nrcif(int x)
{
    int rez=0;
    while(x)
    {
        rez++;
        x/=10;
    }
    return rez;
}

int put(int a, int b)
{
    int rez=1;
    for(int i=0; (1<<i)<=b; i++)
    {
        if((1<<i)&b)
            rez=(1LL*rez*a)%MOD;
        a=(1LL*a*a)%MOD;
    }
    return rez;
}

int nrgr(int x)
{
    int rez=(9LL*put(10,x-1))%MOD;
    return rez;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int s;
    cin>>s;

    //se pot lua mai mult de 2 grupe doar daca nrcifre stanga<=7

    int dr=1;
    int nr=1;
    int rez=0;
    for(int st=1; st<10000000; st++)
    {
        while(nr+nrcif(dr+1)<=s)
        {
            nr+=nrcif(dr+1);
            dr++;
        }

        if(nr==s)
            rez=(rez+1)%MOD;

        nr-=nrcif(st);
    }

    //altfel se iau 2 grupe dif de nr de cifre daca s nu e divizibil cu nr de el din secv
    //sau o grupa daca s e divizibil
    rez=(rez+s/8)%MOD;

    for(int d=1; d*d<=s; d++)
    {
        if(s%d==0)
        {
            if(d<=s/8)
                rez=(1LL*rez+nrgr(s/d)-d+MOD)%MOD;
            if(s/d!=d && s/d<=s/8)
                rez=(1LL*rez+nrgr(d)-s/d+MOD)%MOD;
        }
    }

    cout<<rez<<"\n";
    return 0;
}