#include <bits/stdc++.h>
using namespace std;
namespace BlueQuantum {
int const N = 1 << 17, P = 998244353, g = 3, ig = 332748118;
int Cvt[N << 2];
inline long long qpow(long long base, int exp) {
  long long res = 1;
  while (exp) {
    if (exp & 1) res = res * base % P;
    base = base * base % P;
    exp >>= 1;
  }
  return res;
}
inline int add(int a, int b) {
  a += b;
  return a >= P ? a - P : a;
}
inline int dec(int a, int b) {
  a -= b;
  return a < 0 ? a + P : a;
}
inline void NTT(int *const f, int n, bool typ) {
  for (int i = 1, *cvt = Cvt + n - 1; i < n; ++i)
    if (i < cvt[i]) swap(f[i], f[cvt[i]]);
  for (int i = 2; i <= n; i <<= 1) {
    int mid = i >> 1, w = qpow(typ ? g : ig, (P - 1) / i);
    for (int j = 0; j < n; j += i) {
      long long wk = 1;
      for (int k = 0; k < mid; ++k, wk = wk * w % P) {
        long long tmp = f[j + k + mid] * wk % P;
        f[j + k + mid] = dec(f[j + k], tmp);
        f[j + k] = add(f[j + k], tmp);
      }
    }
  }
  if (typ == false) {
    long long inv = qpow(n, P - 2);
    for (int i = 0; i < n; ++i) f[i] = inv * f[i] % P;
  }
}
inline void prework(int n) {
  for (int i = 2; i <= n; i <<= 1) {
    for (int j = 1, *const cvt = Cvt + i - 1; j < i; ++j) {
      cvt[j] = cvt[j >> 1] >> 1 | (j & 1) * (i >> 1);
    }
  }
}
void PolyInv(int *const Res, int *const F, int n) {
  static int _F[N];
  if (n == 1) {
    Res[0] = qpow(F[0], P - 2);
    return;
  }
  PolyInv(Res, F, (n + 1) / 2);
  int maxl = 1, tarl = n * 2;
  while (maxl < tarl) maxl <<= 1;
  memcpy(_F, F, sizeof(int) * n);
  for (int i = n + 1; i < maxl; ++i) _F[i] = 0;
  NTT(Res, maxl, true), NTT(_F, maxl, true);
  for (int i = 0; i < maxl; ++i)
    Res[i] = (long long)Res[i] * dec(2, (long long)_F[i] * Res[i] % P) % P;
  NTT(Res, maxl, false);
  for (int i = n; i < maxl; ++i) Res[i] = 0;
}
int F0[N], F1[N], F2[N], G[N], G0[N], G1[N], G2[N], G0_1[N], G2_3[N], Inv[N],
    Inv2[N];
inline int main() {
  int n;
  cin >> n;
  prework((n + 1) << 2);
  G[0] = 1, G[2] = 1;
  for (int i = 4; i <= n; i += 2) G[i] = add(G[i - 2], G[i - 4]);
  for (int i = 0; i <= n; i += 2) G0[i] = (long long)G[i] * i % P * i % P;
  for (int i = 0; i <= n; i += 2)
    G1[i] = (long long)G[i] * (i + 1) % P * (i + 1) % P;
  for (int i = 0; i <= n; i += 2)
    G2[i] = (long long)G[i] * (i + 2) % P * (i + 2) % P;
  int maxl = 1;
  while (maxl < (n + 1) * 2) maxl <<= 1;
  for (int i = 0; i <= n; ++i)
    G0_1[i] = i < 1 ? 0 : G0[i - 1], G2_3[i] = i < 3 ? 0 : G2[i - 3],
    Inv2[i] = G0[i], Inv[i] = G1[i], F1[i] = G1[i];
  G0_1[0]--, G2_3[0]--;
  NTT(G0_1, maxl, true), NTT(G2_3, maxl, true), NTT(Inv2, maxl, true),
      NTT(Inv, maxl, true);
  for (int i = 0; i < maxl; ++i) {
    G0_1[i] = (long long)G0_1[i] * G2_3[i] % P;
    G2_3[i] = (long long)Inv2[i] * G2_3[i] % P;
    Inv[i] = (long long)Inv[i] * Inv[i] % P;
  }
  NTT(G0_1, maxl, false), NTT(G2_3, maxl, false), NTT(Inv, maxl, false);
  for (int i = n + 1; i < maxl; ++i) G0_1[i] = 0, G2_3[i] = 0, Inv[i] = 0;
  for (int i = 0; i < maxl; ++i)
    Inv2[i] = dec(G0_1[i], (i < 4 ? 0 : Inv[i - 4])),
    F0[i] = dec((i < 3 ? 0 : Inv[i - 3]), G2_3[i]);
  for (int i = n + 1; i < maxl; ++i) Inv2[i] = 0;
  memset(Inv, 0, sizeof(Inv));
  PolyInv(Inv, Inv2, n + 1);
  NTT(Inv, maxl, true), NTT(F0, maxl, true), NTT(F1, maxl, true);
  for (int i = 0; i < maxl; ++i)
    F0[i] = (long long)F0[i] * Inv[i] % P,
    F1[i] = (long long)F1[i] * Inv[i] % P;
  NTT(F0, maxl, false), NTT(F1, maxl, false);
  for (int i = n + 1; i < maxl; ++i) F0[i] = F1[i] = 0;
  for (int i = 0; i < maxl; ++i)
    G2_3[i] = G1[i], Inv2[i] = i < 3 ? 0 : P - G2[i - 3], Inv[i] = F1[i];
  Inv2[0]++;
  NTT(G2_3, maxl, true), NTT(Inv, maxl, true);
  for (int i = 0; i < maxl; ++i) G0_1[i] = (long long)G2_3[i] * Inv[i] % P;
  NTT(G0_1, maxl, false);
  for (int i = n + 1; i < maxl; ++i) G0_1[i] = 0;
  for (int i = 0; i <= n; ++i) F2[i] = (G2[i] + (i < 1 ? 0 : G0_1[i - 1])) % P;
  memset(G0_1, 0, sizeof(G0_1));
  PolyInv(G0_1, Inv2, n + 1);
  NTT(F2, maxl, true), NTT(G0_1, maxl, true);
  for (int i = 0; i < maxl; ++i) F2[i] = (long long)F2[i] * G0_1[i] % P;
  NTT(F2, maxl, false);
  for (int i = n + 1; i < maxl; ++i) F2[i] = 0;
  int ans =
      (long long)add(G[n - 1], G[n - 3]) * (n - 1) % P * (n - 1) % P * n % P;
  for (int i = 2; i <= n - 2; ++i) {
    ans = add(ans, (long long)i * (i - 1) % P * (i - 1) % P *
                       add(add((long long)G[i - 1] * F0[n - i - 1] % P,
                               2LL * G[i - 2] % P * F1[n - i - 2] % P),
                           (i >= 3 && i <= n - 3)
                               ? (long long)G[i - 3] * F2[n - i - 3] % P
                               : 0) %
                       P);
  }
  cout << ans;
  return 0;
}
}  // namespace BlueQuantum
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
