#include <bits/stdc++.h>
using namespace std;
const int M = 705;
const int P = (int)1e9 + 7;
int n, dp[M][M][2];
char str[M];
inline void Add(int &a, int b) {
  a += b;
  if (a >= P) a -= P;
}
int main() {
  int ans = 0;
  scanf("%s", str + 1);
  n = strlen(str + 1);
  reverse(str + 1, str + n + 1);
  for (int k = 1; k <= 9; k++) {
    memset(dp, 0, sizeof(dp));
    dp[0][0][0] = 1;
    for (int i = 0; i < n; i++)
      for (int j = 0; j <= i; j++) {
        for (int op = 0; op < 2; op++) {
          for (int t = 0; t <= 9; t++) {
            int nc = op;
            if (t < (str[i + 1] ^ 48)) nc = 0;
            if (t > (str[i + 1] ^ 48)) nc = 1;
            Add(dp[i + 1][j + (t >= k)][nc], dp[i][j][op]);
          }
        }
      }
    int num = 0;
    for (int j = 0; j <= n; j++) {
      ans = (ans + (long long)dp[n][j][0] * num % P) % P;
      num = ((long long)10 * num + 1) % P;
    }
  }
  printf("%d\n", ans);
  return 0;
}
