// #undef _GLIBCXX_DEBUG // #undef LOCAL #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include using namespace std; #if __has_include() #include using namespace atcoder; #endif #ifdef LOCAL #include "../algo/debug.hpp" #else #define debug(...) void(0) #endif constexpr int inf = (1<<30) - 1; constexpr long long linf = (1LL<<60) - 1; using ll = long long; using ld = long double; #define len(x) int((x).size()) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define LB(c, x) distance(begin(c), lower_bound(all(c), x)) #define UB(c, x) distance(begin(c), upper_bound(all(c), x)) template inline auto min(const T& a, const S& b) { return(a < b ? a : b); } template inline auto max(const T& a, const S& b) { return(a > b ? a : b); } template inline bool chmax(T& a, const S& b) { return(a < b ? a = b, 1 : 0); } template inline bool chmin(T& a, const S& b) { return(a > b ? a = b, 1 : 0); } // ------------------------------------------------------------------ void solve() { int N; cin >> N; string S = ""; while(N--) S += '9'; int n = len(S); using mint = modint1000000007; vector dp(n + 1, vector>(2, vector(10, 0))); dp[0][0][0] = 1; for(int i = 0; i < n; i++) { for(int j = 0; j < 2; j++) { for(int k = 0; k < 10; k++) { int lim = j ? 9 : S[i] - '0'; for(int d = 0; d <= lim; d++) { if(k > d) continue; dp[i + 1][j || d < lim][d] += dp[i][j][k]; } } } } mint ans = 0; for(int i = 0; i < 2; i++) { for(int j = 0; j < 10; j++) { ans += dp[n][i][j]; } } cout << ans.val() << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); // fixed(cout).precision(12); int T = 1; // cin >> T; while(T--) { solve(); } }