#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 200005;
const double PI = acos(-1.0);
const double eps = 1e-9;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
char st[705];
int n, x;
long long ans = 0, g[705], dp[705][2];
int main() {
  scanf("%s", st + 1), n = strlen(st + 1);
  for (int i = (1); i <= (n); ++i)
    g[i] = g[i - 1] * 10 + st[i] - '0', g[i] %= _p;
  for (int k = (1); k <= (9); ++k) {
    memset(dp, 0, sizeof(dp));
    for (int i = (0); i <= (n - 1); ++i) {
      x = st[i + 1] - '0';
      (dp[i + 1][0] += dp[i][0] * k + dp[i][1] * ((x) < (k) ? (x) : (k))) %= _p;
      (dp[i + 1][0] += (dp[i][0] * 10 + g[i]) * (10 - k)) %= _p;
      (dp[i + 1][0] += (dp[i][1] * 10 + 1) * (x - ((x) < (k) ? (x) : (k)))) %=
          _p;
      (dp[i + 1][1] += (x < k) ? dp[i][1] : (dp[i][1] * 10 + 1)) %= _p;
    }
    (ans += dp[n][0] + dp[n][1]) %= _p;
  }
  printf("%I64d\n", ans);
  return 0;
}
