#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  char c = getchar();
  T fh = 0;
  bool f = false;
  while (!isdigit(c)) f |= (c == '-'), c = getchar();
  while (isdigit(c)) fh = (fh << 1) + (fh << 3) + (c ^ 48), c = getchar();
  x = f ? -fh : fh;
  return;
}
const int N = 705;
const int mod = 1e9 + 7;
char s[N];
int as[N], x, len;
long long dp[N][N][2], pw[N];
long long dfs(int pos, int sta, bool lim) {
  if (~dp[pos][sta][lim]) return dp[pos][sta][lim];
  if (pos == len + 1) {
    if (!sta) return dp[pos][sta][lim] = 1;
    return dp[pos][sta][lim] = 0;
  }
  int up = lim ? as[pos] : 9;
  long long nw = 0;
  for (int i = (0); i <= (up); ++i) {
    if (!sta && i >= x) break;
    nw = (nw + dfs(pos + 1, sta - (i >= x), lim && (i == up))) % mod;
  }
  return dp[pos][sta][lim] = nw;
}
long long solve() {
  memset(dp, -1, sizeof(dp));
  long long sum = 0;
  for (int i = (len); i >= (1); --i)
    sum = (sum + dfs(1, i, 1) * pw[i - 1] % mod) % mod;
  return sum;
}
int main() {
  cin >> s + 1;
  len = strlen(s + 1);
  pw[0] = 1;
  for (int i = (1); i <= (len); ++i)
    as[i] = s[i] - '0', pw[i] = pw[i - 1] * 10 % mod;
  for (int i = (1); i <= (len); ++i) pw[i] = (pw[i] + pw[i - 1]) % mod;
  long long as1 = 0;
  for (x = 1; x <= 9; ++x) as1 = (as1 + solve()) % mod;
  printf("%d\n", as1);
  return 0;
}
