n = gets.to_i

divisor = 1000000007

dp = Array.new(n+1) { Array.new(4, 0) }
dp[1] = [0, 1, 1, 8]

1.upto(n-1) do |i|

  dp[i+1][0] = dp[i][0]*10 + dp[i][1] + dp[i][2]
  dp[i+1][1] = dp[i][0]*10 + dp[i][1]*9 + dp[i][3]
  dp[i+1][2] = dp[i][0]*10 + dp[i][2]*9 + dp[i][3]
  dp[i+1][3] = dp[i][3]*8

end

# dp.each do |a|
#   p a
# end

puts dp.last.first
