#include <bits/stdc++.h>
#pragma GCC optimize(3, "inline", "Ofast")
using namespace std;
const long long mod = 998244353;
const int N = 4e5 + 100;
long long Add(long long x, long long y) { return (x + y) % mod; }
long long Sub(long long x, long long y) { return (x - y + mod) % mod; }
long long Mul(long long x, long long y) { return x * y % mod; }
long long qpow(long long x, long long y = mod - 2) {
  long long res = 1;
  while (y) {
    if (y & 1) res = Mul(res, x);
    x = Mul(x, x), y >>= 1;
  }
  return res;
}
long long F[N], G[N];
int wh[N], len, cc;
void ntt(long long *a, bool inv) {
  for (int i = 1; i < len; i++)
    if (i < wh[i]) swap(a[i], a[wh[i]]);
  long long tp, mo, ha;
  for (int l = 2, md; l <= len; l <<= 1) {
    md = l >> 1, tp = qpow(3, (mod - 1) / l);
    for (int i = 0; i < len; i += l) {
      mo = 1;
      for (int j = 0; j < md; j++, mo = Mul(mo, tp)) {
        ha = Mul(a[i + j + md], mo);
        a[i + j + md] = Sub(a[i + j], ha);
        a[i + j] = Add(a[i + j], ha);
      }
    }
  }
  if (inv) {
    tp = qpow(len);
    for (int i = 1; i < len / 2; i++) swap(a[i], a[len - i]);
    for (int i = 0; i < len; i++) a[i] = Mul(a[i], tp);
  }
}
void pre_ntt(int le) {
  cc = 0, len = 1;
  while (len <= le) ++cc, len <<= 1;
  for (int i = 1; i < len; i++)
    wh[i] = (wh[i >> 1] >> 1) | ((i & 1) << (cc - 1));
}
void clr() {
  for (int i = 0; i < len; i++) F[i] = G[i] = 0;
}
int n;
long long f0[N], f1[N], f2[N], g[N];
void sol1(int l, int r) {
  if (l == r) {
    f0[l] = Add(f0[l], Mul(g[l], Mul(l, l)));
    f1[l] = Add(f1[l], Mul(g[l], Mul(l + 1, l + 1)));
    return;
  }
  int mid = (l + r) >> 1;
  sol1(l, mid);
  pre_ntt(mid - l + 1 + r - l + 1);
  clr();
  for (int i = l; i <= mid; i++) F[i - l] = f0[i];
  for (int i = 0; i <= r - l; i++) G[i] = Mul(g[i], Mul(i, i));
  ntt(F, 0), ntt(G, 0);
  for (int i = 0; i < len; i++) F[i] = Mul(F[i], G[i]);
  ntt(F, 1);
  for (int i = mid + 1; i <= r; i++)
    if (i - l - 1 >= 0) f0[i] = Add(f0[i], F[i - l - 1]);
  clr();
  for (int i = l; i <= mid; i++) F[i - l] = f1[i];
  for (int i = 0; i <= r - l; i++) G[i] = Mul(g[i], Mul(i + 1, i + 1));
  ntt(F, 0), ntt(G, 0);
  for (int i = 0; i < len; i++) F[i] = Mul(F[i], G[i]);
  ntt(F, 1);
  for (int i = mid + 1; i <= r; i++)
    if (i - l - 3 >= 0) f0[i] = Add(f0[i], F[i - l - 3]);
  clr();
  for (int i = l; i <= mid; i++) F[i - l] = f0[i];
  for (int i = 0; i <= r - l; i++) G[i] = Mul(g[i], Mul(i + 1, i + 1));
  ntt(F, 0), ntt(G, 0);
  for (int i = 0; i < len; i++) F[i] = Mul(F[i], G[i]);
  ntt(F, 1);
  for (int i = mid + 1; i <= r; i++)
    if (i - l - 1 >= 0) f1[i] = Add(f1[i], F[i - l - 1]);
  clr();
  for (int i = l; i <= mid; i++) F[i - l] = f1[i];
  for (int i = 0; i <= r - l; i++) G[i] = Mul(g[i], Mul(i + 2, i + 2));
  ntt(F, 0), ntt(G, 0);
  for (int i = 0; i < len; i++) F[i] = Mul(F[i], G[i]);
  ntt(F, 1);
  for (int i = mid + 1; i <= r; i++)
    if (i - l - 3 >= 0) f1[i] = Add(f1[i], F[i - l - 3]);
  sol1(mid + 1, r);
}
void sol2(int l, int r) {
  if (l == r) {
    f2[l] = Add(f2[l], Mul(g[l], Mul(l + 2, l + 2)));
    return;
  }
  int mid = (l + r) >> 1;
  sol2(l, mid);
  pre_ntt(mid - l + 1 + r - l + 1);
  clr();
  for (int i = l; i <= mid; i++) F[i - l] = f1[i];
  for (int i = 0; i <= r - l; i++) G[i] = Mul(g[i], Mul(i + 1, i + 1));
  ntt(F, 0), ntt(G, 0);
  for (int i = 0; i < len; i++) F[i] = Mul(F[i], G[i]);
  ntt(F, 1);
  for (int i = mid + 1; i <= r; i++)
    if (i - l - 1 >= 0) f2[i] = Add(f2[i], F[i - l - 1]);
  clr();
  for (int i = l; i <= mid; i++) F[i - l] = f2[i];
  for (int i = 0; i <= r - l; i++) G[i] = Mul(g[i], Mul(i + 2, i + 2));
  ntt(F, 0), ntt(G, 0);
  for (int i = 0; i < len; i++) F[i] = Mul(F[i], G[i]);
  ntt(F, 1);
  for (int i = mid + 1; i <= r; i++)
    if (i - l - 3 >= 0) f2[i] = Add(f2[i], F[i - l - 3]);
  sol2(mid + 1, r);
}
signed main() {
  cin >> n;
  g[0] = g[2] = 1;
  for (int i = 4; i <= n; i++) g[i] = Add(g[i - 2], g[i - 4]);
  sol1(0, n), sol2(0, n);
  long long ans = 0, res;
  ans = Add(ans, 1LL * (n - 1) * (n - 1) % mod * g[n - 1] % mod * n % mod);
  ans = Add(ans, 1LL * (n - 1) * (n - 1) % mod * g[n - 3] % mod * n % mod);
  for (int x = 0; x <= n - 2; x++) {
    res = 0;
    res = Add(res, Mul(Mul(Mul(x, x), g[x]), f0[n - x - 2]));
    if (n - x - 3 >= 0 && x >= 1)
      res = Add(res, 2LL * x * x % mod * g[x - 1] % mod * f1[n - x - 3] % mod);
    if (n - x - 4 >= 0 && x >= 2)
      res = Add(res, 1LL * x * x % mod * g[x - 2] % mod * f2[n - x - 4] % mod);
    ans = Add(ans, Mul(res, x + 1));
  }
  printf("%lld\n", ans);
  return 0;
}
