#include using namespace std; const long long MOD = 1000000007; int main(){ string N; cin >> N; int L = N.size(); vector> dp(L + 1, vector(2, 0)); dp[0][0] = 1; for (int i = 1; i < L; i++){ dp[i][1] = 1; } for (int i = 0; i < L; i++){ for (int j = 0; j < 2; j++){ for (int k = 0; k < 10; k++){ if (!(j == 0 && k > N[i] - '0')){ int j2 = j; if (k < N[i] - '0'){ j2 = 1; } dp[i + 1][j2] += dp[i][j] * k; dp[i + 1][j2] %= MOD; } } } } cout << (dp[L][0] + dp[L][1]) % MOD << endl; }