#include <bits/stdc++.h>
using namespace std;
const int MAXN = 705, Mod = 1e9 + 7;
const double pie = acos(-1);
char buf[1 << 12], *pp1 = buf, *pp2 = buf, nc;
int ny;
inline char gc() { return getchar(); }
inline int read() {
  int x = 0;
  for (ny = 1; nc = gc(), (nc < 48 || nc > 57) && nc != EOF;)
    if (nc == 45) ny = -1;
  if (nc < 0) return nc;
  for (x = nc - 48; nc = gc(), 47 < nc && nc < 58 && nc != EOF;
       x = (x << 3) + (x << 1) + (nc ^ 48))
    ;
  return x * ny;
}
char s[MAXN];
int a[MAXN], len, S[MAXN], f[MAXN][MAXN][10][2], ans = 0;
int dfs(int x, int y, int k, int opt) {
  if (!x) return y == 0;
  if (y < 0) return 0;
  if (~f[x][y][k][opt]) return f[x][y][k][opt];
  int tmp = 0, Mx = opt ? a[x] : 9;
  for (int i = 0; i <= Mx; i++)
    tmp = (tmp + dfs(x - 1, y - (i >= k), k, opt && Mx == i)) % Mod;
  return f[x][y][k][opt] = tmp;
}
int main() {
  scanf("%s", s + 1), len = strlen(s + 1), memset(f, -1, sizeof(f));
  for (int i = 1; i <= len; i++)
    a[i] = s[len - i + 1] ^ 48, S[i] = (1ll * S[i - 1] * 10 + 1) % Mod;
  for (int i = 1; i <= 9; i++)
    for (int j = 1; j <= len; j++)
      ans = (ans + 1ll * dfs(len, j, i, 1) * S[j]) % Mod;
  cout << ans << '\n';
  return 0;
}
