main :: IO ()
main = do
  l1 <- getLine
  let n = read l1 :: Integer
  print $ h $ pow' 3 n 1 - (sum (map (f n) [1,3..n])`mod`998244353)

f n m = fact' n 1`div`(fact' m 1 * fact' (n - m) 1)

pow' x 0 acc = acc
pow' x n acc = pow' x (n-1) $ x*acc`mod`998244353

fact' 0 acc = acc
fact' n acc = fact' (n-1) $ n*acc`mod`998244353

h x = if x < 0 then x + 998244353 else x