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;
const int MOD = 1000000007;

int main(){
	int n;
	scanf("%d", &n);
	int base, base_, cnt, cnt_, l, r, s, ans = 0, i, q, nxt, j;
	base = base_ = 10, cnt = cnt_ = l = r = s = 1;
	for(; l < 100000000; ++ l){
		while(s < n){
			if((++ r) == base)
				base *= 10, ++ cnt;
			s += cnt;
		}
		if(s == n && (++ ans) == MOD)
			ans = 0;
		s -= cnt_;
		if(l + 1 == base_)
			base_ *= 10, ++ cnt_;
	} base = base_ / 10;
	for(i = 9; i <= n; i = nxt + 1){
		q = n / i, nxt = n / q;
		for(j = i, r = n - q * j; j <= nxt; ++ j, r -= q, base = (base * 10LL) % MOD){
			if(r >= q) continue;
			cnt = (base * 9LL) % MOD;
			if(r == 0){
				ans = ans + cnt - q + 1;
				if(ans >= MOD) ans -= MOD;
				else if(ans < 0) ans += MOD;
			}
			ans = ans + (q - r - 1) / (j + 1) + bool(r);
			if(ans >= MOD) ans -= MOD;
		}
	} printf("%d\n", ans);
	return 0;
}