#include <bits/stdc++.h>
using namespace std;
const long long maxm = 700 + 5;
const long long mod = 1e9 + 7;
long long d[maxm][maxm][2];
long long p[maxm];
char s[maxm];
long long n;
signed main() {
  ios::sync_with_stdio(0);
  for (long long i = 1; i < maxm; i++) p[i] = (p[i - 1] * 10 + 1) % mod;
  cin >> (s + 1);
  n = strlen(s + 1);
  for (long long i = 1; i <= n; i++) s[i] -= '0';
  long long ans = 0;
  for (long long j = 1; j <= 9; j++) {
    memset(d, 0, sizeof d);
    for (long long x = 0; x <= s[1]; x++) {
      d[1][x >= j][x == s[1]]++;
    }
    for (long long i = 1; i <= n - 1; i++) {
      for (long long k = 0; k <= i; k++) {
        for (long long l = 0; l < 2; l++) {
          if (!d[i][k][l]) continue;
          long long ma = (l ? s[i + 1] : 9);
          for (long long x = 0; x <= ma; x++) {
            d[i + 1][k + (x >= j)][l && (x == ma)] += d[i][k][l];
            d[i + 1][k + (x >= j)][l && (x == ma)] %= mod;
          }
        }
      }
    }
    for (long long k = 0; k <= n; k++) {
      ans += p[k] * (d[n][k][0] + d[n][k][1]) % mod;
      ans %= mod;
    }
  }
  cout << ans << endl;
  return 0;
}
