#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long nm = 0;
  bool fh = true;
  char cw = getchar();
  for (; !isdigit(cw); cw = getchar()) fh ^= (cw == '-');
  for (; isdigit(cw); cw = getchar()) nm = nm * 10 + (cw - '0');
  return fh ? nm : -nm;
}
namespace CALC {
inline int add(int x, int y) {
  return (x + y >= 1000000007) ? (x + y - 1000000007) : (x + y);
}
inline int mns(int x, int y) {
  return (x - y < 0) ? (x - y + 1000000007) : (x - y);
}
inline int mul(int x, int y) {
  return (long long)x * (long long)y % 1000000007;
}
inline void upd(int &x, int y) {
  x += y;
  (x >= 1000000007) ? (x -= 1000000007) : 0;
}
inline void dec(int &x, int y) {
  x -= y;
  (x < 0) ? (x += 1000000007) : 0;
}
inline int qpow(int x, int sq) {
  int res = 1;
  for (; sq; sq >>= 1, x = mul(x, x))
    if (sq & 1) res = mul(res, x);
  return res;
}
}  // namespace CALC
using namespace CALC;
int n, F[800][2], G[800][2], ans;
char ch[800];
int t[800];
inline int calc(int D) {
  memset(F, 0, sizeof(F)), memset(G, 0, sizeof(G)), F[n + 1][1] = 1;
  for (int i = n + 1; i > 1; --i)
    for (int j = 0; j < 2; j++)
      if (G[i][j] > 0 || F[i][j] > 0) {
        for (int d = ((j == 1) ? t[i - 1] : 9); d >= 0; --d) {
          int nxt = (j == 1 && d == t[i - 1]);
          upd(F[i - 1][nxt], F[i][j]);
          if (d >= D)
            upd(G[i - 1][nxt], add(mul(10, G[i][j]), F[i][j]));
          else
            upd(G[i - 1][nxt], G[i][j]);
        }
      }
  return add(G[1][0], G[1][1]);
}
int main() {
  scanf("%s", ch + 1), n = strlen(ch + 1), reverse(ch + 1, ch + n + 1);
  for (int i = 1; i <= n; i++) t[i] = ch[i] - '0';
  for (int i = 1; i <= 9; i++) upd(ans, calc(i));
  printf("%d\n", ans);
  return 0;
}
