#include <bits/stdc++.h>
using namespace std;
const int P = 998244353, N = 3e5;
int n, L, C, r[N], A[N], B[N];
int g[N], g0[N], g1[N], g2[N];
int f0[N], f1[N], f2[N];
int q0[N], q1[N];
int t1[N], t2[N], t3[N], t4[N];
inline void Add(int &x, int y) {
  x += y;
  if (x >= P) x -= P;
}
inline int Mul(int x, int y) { return 1ll * x * y % P; }
inline int fpow(int x, int k) {
  int s = 1;
  for (; k; k >>= 1, x = Mul(x, x))
    if (k & 1) s = Mul(s, x);
  return s;
}
inline void NTT_prepare(int len) {
  for (L = 1, C = 0; L < len; L <<= 1, ++C)
    ;
  for (int i = 0; i < L; ++i) r[i] = (r[i >> 1] >> 1) | ((i & 1) << (C - 1));
}
void NTT(int *A, int op) {
  for (int i = 0; i < L; ++i)
    if (i < r[i]) swap(A[i], A[r[i]]);
  for (int i = 1; i < L; i <<= 1) {
    int Wn = fpow(3, (P - 1) / (i << 1));
    if (op == -1) Wn = fpow(Wn, P - 2);
    for (int j = 0; j < L; j += i << 1) {
      int w = 1;
      for (int k = 0; k < i; ++k, w = Mul(w, Wn)) {
        int p = A[j + k], q = Mul(w, A[j + i + k]);
        A[j + k] = (p + q) % P;
        A[j + i + k] = ((p - q) % P + P) % P;
      }
    }
  }
  if (op == -1) {
    int inv_L = fpow(L, P - 2);
    for (int i = 0; i < L; ++i) A[i] = Mul(A[i], inv_L);
  }
}
void Convolve(int *a, int *b, int *C) {
  for (int i = 0; i < L / 2; ++i) A[i] = a[i];
  for (int i = 0; i < L / 2; ++i) B[i] = b[i];
  for (int i = L / 2; i < L; ++i) A[i] = B[i] = 0;
  NTT(A, 1);
  NTT(B, 1);
  for (int i = 0; i < L; ++i) C[i] = Mul(A[i], B[i]);
  NTT(C, -1);
}
void Solve_1(int l, int r) {
  if (l == r) {
    Add(f0[l], g0[l]);
    Add(f1[l], g1[l]);
    return;
  }
  int mid = (l + r) / 2;
  Solve_1(l, mid);
  NTT_prepare(2 * (r - l + 1));
  for (int i = 0; i < L; ++i) q0[i] = (i + l <= mid ? f0[i + l] : 0);
  for (int i = 0; i < L; ++i) q1[i] = (i + l <= mid ? f1[i + l] : 0);
  Convolve(g0, q0, t1);
  Convolve(g1, q0, t2);
  Convolve(g1, q1, t3);
  Convolve(g2, q1, t4);
  for (int i = 0; i < L / 2; ++i) {
    if (mid + 1 <= i + l + 1 && i + l + 1 <= r) {
      Add(f0[i + l + 1], t1[i]);
      Add(f1[i + l + 1], t2[i]);
    }
    if (mid + 1 <= i + l + 3 && i + l + 3 <= r) {
      Add(f0[i + l + 3], t3[i]);
      Add(f1[i + l + 3], t4[i]);
    }
  }
  Solve_1(mid + 1, r);
}
void Solve_2(int l, int r) {
  if (l == r) {
    Add(f2[l], g2[l]);
    Add(f2[l], l >= 1 ? t1[l - 1] : 0);
    return;
  }
  int mid = (l + r) / 2;
  Solve_2(l, mid);
  NTT_prepare(2 * (r - l + 1));
  for (int i = 0; i < L; ++i) q0[i] = (i + l <= mid ? f2[i + l] : 0);
  Convolve(g2, q0, t2);
  for (int i = 0; i < L / 2; ++i) {
    if (mid + 1 - 3 <= i + l && i + l <= r - 3) {
      Add(f2[i + l + 3], t2[i]);
    }
  }
  Solve_2(mid + 1, r);
}
int main() {
  scanf("%d", &n);
  g[0] = 1;
  g[2] = 1;
  for (int i = 4; i <= n; i += 2) g[i] = (g[i - 2] + g[i - 4]) % P;
  for (int i = 0; i <= n; ++i) {
    g0[i] = Mul(g[i], Mul(i, i));
    g1[i] = Mul(g[i], Mul(i + 1, i + 1));
    g2[i] = Mul(g[i], Mul(i + 2, i + 2));
  }
  Solve_1(0, n);
  NTT_prepare(2 * n);
  Convolve(g1, f1, t1);
  Solve_2(0, n);
  int ans = Mul(Mul((g[n - 1] + g[n - 3]) % P, Mul(n - 1, n - 1)), n);
  for (int i = 2; i <= n - 2; ++i) {
    Add(ans, Mul(Mul(Mul(g[i - 1], Mul(i - 1, i - 1)), f0[n - i - 1]), i));
    Add(ans,
        Mul(Mul(Mul(g[i - 2], Mul(i - 1, i - 1)), f1[n - i - 2]), Mul(2, i)));
    if (3 <= i && i <= n - 3)
      Add(ans, Mul(Mul(Mul(g[i - 3], Mul(i - 1, i - 1)), f2[n - i - 3]), i));
  }
  printf("%d\n", ans);
  return 0;
}
