program neither_AB_nor_BA
  implicit none
  integer(8), parameter :: md = 998244353_8
  integer(8) :: n, i, p = 1_8, c = 1_8, x = 0_8
  read(*,*) n
  do i = 0_8, (n-1_8)/2_8
    x = mod(x+p*c,md)
    p = mod(2_8*p,md)
    c = mod(c*(n-i),md)
    c = mod(c*inv(i+1_8),md)
  end do
  write(*,'(i0)') modulo(pow(3_8,int(n,4))-2_8*x,md)
contains
  function inv(n) result(y)
    integer(8), intent(in) :: n
    integer(8) :: a, b, x, y, t, q
    a = modulo(n,md)
    b = md
    x = 0_8
    y = 1_8
    do while (b /= 0_8)
      q = a/b
      t = b
      b = mod(a,b)
      a = t
      t = y
      y = x
      x = t-q*x
    end do
    y = modulo(y,md)
  end
  function pow(a,b) result(r)
    integer(8), intent(in) :: a
    integer, intent(in) :: b
    integer :: k
    integer(8) :: r, p
    r = 1_8
    p = a
    k = b
    do while (k > 0)
      if (btest(k,0)) r = mod(r*p,md)
      p = mod(p*p,md)
      k = rshift(k,1)
    end do
  end
end program neither_AB_nor_BA