M = 1e9.to_i + 7 n = gets.to_i dp = Array.new(2) { [0] * 10 } dp[0][0] = 1 n.times do |i| ndp = Array.new(2) { [0] * 10 } 2.times do |l| lim = 10 10.times do |r| break if dp[l][r] == 0 (r...lim).each do |d| ndp[l | (d < lim ? 1 : 0)][d] = (dp[l][r] + ndp[l | (d < lim ? 1 : 0)][d]) % M end end end dp = ndp end puts (dp[0].sum + dp[1].sum + M) % M