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 <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <vector>
using namespace std;

#define bll long long
#define dou double
#define For(i,a,b) for (int i=(a),_##i=(b); i<=_##i; ++i)
#define Rof(i,a,b) for (int i=(a),_##i=(b); i>=_##i; --i)
#define Mem(a,b) memset(a,b,sizeof(a))
#define Cpy(a,b) memcpy(a,b,sizeof(b))

const int maxn=2e7+3e6+10;
const int mod=1e9+7;
int S,f[maxn];

int mul(int a,int k)
{
    long long ret=1,s=a;
    for (; k; k>>=1)
    {
        if (k&1) ret=ret*s % mod;
        s=s*s % mod;
    }
    return ret % mod;
}

inline int calc(int t)
{
    int d=S/t;
    int nd=(mul(10,d)-mul(10,d-1)+mod) % mod;
    return (nd-t+mod) % mod;
}

int main()
{
    f[0]=0;
    For(i,1,maxn-1) f[i]=f[i/10]+1;
    for (; scanf("%d",&S)!=EOF; )
    {
        int ret=0;
        int j=1,sum=f[1];
        For(i,1,1e7-1)
        {
            for (; j+1<maxn && sum<S; sum+=f[++j]);
            if (sum==S) ++ret;
            sum-=f[i];
        }
        int div8=S/8;
        ret+=div8;
        for (int i=1; i*i<=S; ++i)
            if (S%i==0)
            {
                if (i<=div8) ret=(ret+calc(i)) % mod;
                int j=S/i;
                if (i!=j && j<=div8) ret=(ret+calc(j)) % mod;
            }
        printf("%d\n",ret);
    }
    return 0;
}