import bisect import copy import decimal import fractions import functools import heapq import itertools import math import random import sys from collections import Counter,deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines def Bostan_Mori(poly_nume,poly_deno,N,mod=0,fft=False,ntt=False): if ntt: convolve=NTT elif fft: convolve=FFT else: def convolve(poly_nume,poly_deno): conv=[0]*(len(poly_nume)+len(poly_deno)-1) for i in range(len(poly_nume)): for j in range(len(poly_deno)): x=poly_nume[i]*poly_deno[j] if mod: x%=mod conv[i+j]+=x if mod: for i in range(len(conv)): conv[i]%=mod return conv while N: poly_deno_=[-x if i%2 else x for i,x in enumerate(poly_deno)] if N%2: poly_nume=convolve(poly_nume,poly_deno_)[1::2] else: poly_nume=convolve(poly_nume,poly_deno_)[::2] poly_deno=convolve(poly_deno,poly_deno_)[::2] if fft and mod: for i in range(len(poly_nume)): poly_nume[i]%=mod for i in range(len(poly_deno)): poly_deno[i]%=mod N//=2 return poly_nume[0] N=int(readline()) mod=998244353 ans=(Bostan_Mori([1],[1,-1,-1],N,mod=mod)-1)%mod print(ans)