#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 10, P = 998244353;
long long n, m, r[N], g[N], h[3][N], f[3][N];
long long t[3][N], T[2][N], z[4][N];
long long power(long long x, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * x % P;
    x = x * x % P;
    b >>= 1;
  }
  return ans;
}
void Glen(long long n) {
  m = 1;
  while (m <= n) m <<= 1;
  for (long long i = 0; i < m; i++)
    r[i] = (r[i >> 1] >> 1) | ((i & 1) ? (m >> 1) : 0);
  return;
}
void NTT(long long *f, long long op) {
  for (long long i = 0; i < m; i++)
    if (i < r[i]) swap(f[i], f[r[i]]);
  for (long long p = 2; p <= m; p <<= 1) {
    long long len = (p >> 1), tmp = power(3, (P - 1) / p);
    if (op == -1) tmp = power(tmp, P - 2);
    for (long long k = 0; k < m; k += p) {
      long long buf = 1;
      for (long long i = k; i < k + len; i++) {
        long long tt = buf * f[i + len] % P;
        f[i + len] = (f[i] - tt + P) % P;
        f[i] = (f[i] + tt) % P;
        buf = buf * tmp % P;
      }
    }
  }
  if (op == -1) {
    long long inv = power(m, P - 2);
    for (long long i = 0; i < m; i++) f[i] = f[i] * inv % P;
  }
  return;
}
void CDQ(long long l, long long r) {
  if (l == r) {
    (f[0][l] += h[0][l]) %= P;
    (f[1][l] += h[1][l]) %= P;
    return;
  }
  long long mid = (l + r) >> 1;
  CDQ(l, mid);
  Glen((r - l + 1) * 2);
  for (long long i = 0; i < m; i++)
    t[0][i] = t[1][i] = t[2][i] = T[0][i] = T[1][i] = 0;
  for (long long i = 0; i <= r - l + 1; i++)
    t[0][i] = h[0][i], t[1][i] = h[1][i], t[2][i] = h[2][i];
  for (long long i = 0; i <= mid - l; i++)
    T[0][i] = f[0][i + l], T[1][i] = f[1][i + l];
  NTT(t[0], 1);
  NTT(t[1], 1);
  NTT(t[2], 1);
  NTT(T[0], 1);
  NTT(T[1], 1);
  for (long long i = 0; i < m; i++) {
    z[0][i] = t[0][i] * T[0][i] % P, z[1][i] = t[1][i] * T[1][i] % P;
    z[2][i] = t[1][i] * T[0][i] % P, z[3][i] = t[2][i] * T[1][i] % P;
  }
  NTT(z[0], -1);
  NTT(z[1], -1);
  NTT(z[2], -1);
  NTT(z[3], -1);
  for (long long i = 0; i <= r - l + 1; i++) {
    if (l + i + 1 > mid && l + i + 1 <= r) {
      f[0][l + i + 1] = (f[0][l + i + 1] + z[0][i]) % P;
      f[1][l + i + 1] = (f[1][l + i + 1] + z[2][i]) % P;
    }
    if (l + i + 3 > mid && l + i + 3 <= r) {
      f[0][l + i + 3] = (f[0][l + i + 3] + z[1][i]) % P;
      f[1][l + i + 3] = (f[1][l + i + 3] + z[3][i]) % P;
    }
  }
  CDQ(mid + 1, r);
  return;
}
void solve(long long l, long long r) {
  if (l == r) {
    (f[2][l] += h[2][l]) %= P;
    return;
  }
  long long mid = (l + r) >> 1;
  solve(l, mid);
  Glen((r - l + 1) * 2);
  for (long long i = 0; i < m; i++) t[1][i] = t[2][i] = T[0][i] = T[1][i] = 0;
  for (long long i = 0; i <= r - l + 1; i++)
    t[1][i] = h[1][i], t[2][i] = h[2][i];
  for (long long i = 0; i <= mid - l; i++)
    T[0][i] = f[1][l + i], T[1][i] = f[2][l + i];
  NTT(t[1], 1);
  NTT(t[2], 1);
  NTT(T[0], 1);
  NTT(T[1], 1);
  for (long long i = 0; i < m; i++) {
    z[0][i] = t[1][i] * T[0][i] % P;
    z[1][i] = t[2][i] * T[1][i] % P;
  }
  NTT(z[0], -1);
  NTT(z[1], -1);
  for (long long i = 0; i < r - l + 1; i++) {
    if (l + i + 1 > mid && l + i + 1 <= r) (f[2][l + i + 1] += z[0][i]) %= P;
    if (l + i + 3 > mid && l + i + 3 <= r) (f[2][l + i + 3] += z[1][i]) %= P;
  }
  solve(mid + 1, r);
  return;
}
signed main() {
  scanf("%lld", &n);
  g[0] = g[2] = 1;
  for (long long i = 4; i <= n; i++) g[i] = (g[i - 4] + g[i - 2]) % P;
  for (long long i = 0; i <= n; i++) {
    h[0][i] = g[i] * i % P * i % P;
    h[1][i] = g[i] * (i + 1) % P * (i + 1) % P;
    h[2][i] = g[i] * (i + 2) % P * (i + 2) % P;
  }
  CDQ(0, n);
  solve(0, n);
  long long ans = (g[n - 1] + g[n - 3]) * (n - 1) % P * (n - 1) % P * n % P;
  for (long long i = 2; i < n - 1; i++) {
    long long tmp = g[i - 1] * f[0][n - i - 1] % P;
    tmp = (tmp + 2 * g[i - 2] * f[1][n - i - 2] % P) % P;
    tmp = (tmp + g[i - 3] * f[2][n - i - 3] % P) % P;
    tmp = tmp * i % P * (i - 1) % P * (i - 1) % P;
    ans = (ans + tmp) % P;
  }
  printf("%lld\n", ans);
  return 0;
}
