import sys input = sys.stdin.readline def Matprod(A, B, mod, N): temp = [0] * N*N for i in range(N): for j in range(N): ij = i * N + j for k in range(N): temp[ij] += A[i*N+k] * B[k*N+j] temp[ij] %= mod return temp def Matpow_Linear(A, M, mod, N): Mat = [0] * N*N for i in range(N): Mat[i*N+i] = 1 while M: if M & 1: Mat = Matprod(Mat, A, mod, N) A = Matprod(A, A, mod, N) M >>= 1 return Mat N = int(input()) A = [1, 1, 1, 0] mod = 998244353 A = Matpow_Linear(A, N, mod, 2) print((A[0] - 1) % mod)