#include <bits/stdc++.h>
using namespace std;
inline int readint() {
  int a = 0;
  char c = getchar(), f = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -f;
  for (; '0' <= c && c <= '9'; c = getchar())
    a = (a << 3) + (a << 1) + (c ^ 48);
  return a * f;
}
const int Mod = 1e9 + 7;
const int MaxN = 705;
int num[MaxN], n;
int solve(int d) {
  long long g0 = 1, f0 = 0, g1 = 0, f1 = 0;
  for (int i = 1, t; i <= n; ++i) {
    ;
    f1 = ((100 - 9 * d) * f1 + d * g1) % Mod;
    g1 = (91 - 9 * d) * g1 % Mod;
    ;
    f1 += (t = min(num[i], d)) * f0 % Mod;
    if (d < num[i]) f1 += d * g0 % Mod;
    f1 += (num[i] - t) * 10 * f0 % Mod;
    g1 += (t = min(num[i], d + 1)) * g0 % Mod;
    g1 += (num[i] - t) * 10 * g0 % Mod;
    ;
    f0 = (f0 * ((num[i] < d) ? 1 : 10) + (num[i] == d) * d * g0) % Mod;
    g0 = g0 * ((num[i] > d) ? 10 : 1) % Mod;
  }
  return f1 % Mod;
}
char str[MaxN];
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  for (int i = 1; i <= n; ++i) num[i] = str[i] - '0';
  ++num[n];
  int ans = 0;
  for (int i = 1; i <= 9; ++i) ans = (ans + solve(i)) % Mod;
  printf("%d\n", ans);
  return 0;
}
