import java.io.BufferedReader; import java.io.InputStreamReader; import java.math.BigDecimal; import java.math.BigInteger; public class No220_2 { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); int P = Integer.parseInt(br.readLine()); // 10^n-1-(2/3)×9^n // なんかPがでかいと誤差死するので3で割るのは最後にする BigInteger p10 = new BigInteger("10").pow(P).multiply( new BigInteger("3")); BigInteger p9 = new BigInteger("9").pow(P); p9 = p9.multiply(new BigInteger("2")); BigInteger ans = p10.subtract(BigInteger.ONE).subtract(p9); System.out.println(ans.divide(new BigInteger("3"))); } catch (Exception e) { System.err.println("Error:" + e.getMessage()); } } }