#include <bits/stdc++.h>
using namespace std;
namespace polynomials {
int const p = 998244353, G = 3;
int const N = (1 << 18) + 1;
int w[N], iv[N], r[N], last;
int mod(int x) { return x >= p ? x - p : x; }
int pw(int x, int y) {
  int res = 1;
  while (y) {
    if (y & 1) res = 1ll * res * x % p;
    x = 1ll * x * x % p;
    y >>= 1;
  }
  return res;
}
void init(int n) {
  int lim = 1;
  while (lim < n) lim <<= 1;
  iv[1] = 1;
  for (int i = 2; i <= lim; i++) iv[i] = mod(p - 1ll * (p / i) * iv[p % i] % p);
  for (int i = 1; i < lim; i <<= 1) {
    int wn = pw(G, (p - 1) / (i << 1));
    for (int j = 0, ww = 1; j < i; j++, ww = 1ll * ww * wn % p) w[i + j] = ww;
  }
}
void ntt(vector<int> &f, int n, int op) {
  f.resize(n);
  for (int i = 1; i < n; i++)
    r[i] = (r[i >> 1] >> 1) | ((i & 1) ? (n >> 1) : 0);
  for (int i = 1; i < n; i++)
    if (i < r[i]) swap(f[i], f[r[i]]);
  for (int i = 1; i < n; i <<= 1)
    for (int j = 0; j < n; j += i << 1)
      for (int k = 0; k < i; k++) {
        int x = f[j + k], y = 1ll * f[i + j + k] * w[i + k] % p;
        f[j + k] = mod(x + y);
        f[i + j + k] = mod(x - y + p);
      }
  if (op == -1) {
    reverse(&f[1], &f[n]);
    for (int i = 0; i < n; i++) f[i] = 1ll * f[i] * iv[n] % p;
  }
}
}  // namespace polynomials
using namespace polynomials;
int g[50005], g0[50005], g1[50005], g2[50005], f0[50005], f1[50005], f2[50005];
vector<int> mul(vector<int> x, vector<int> y) {
  int lim = 1, n = x.size() + y.size() - 1;
  while (lim < n) lim <<= 1;
  ntt(x, lim, 1), ntt(y, lim, 1);
  for (int i = 0; i < lim; i++) x[i] = 1ull * x[i] * y[i] % p;
  ntt(x, lim, -1);
  x.resize(n);
  return x;
}
void solve(int l, int r) {
  if (l == r) return;
  int mid = (l + r) >> 1;
  solve(l, mid);
  vector<int> x = mul(vector<int>(f0 + l, f0 + mid + 1),
                      vector<int>(g0, g0 + r - l + 1)),
              y = mul(vector<int>(f1 + l, f1 + mid + 1),
                      vector<int>(g1, g1 + r - l + 1)),
              z = mul(vector<int>(f2 + l, f2 + mid + 1),
                      vector<int>(g2, g2 + r - l + 1)),
              t = mul(vector<int>(f1 + l, f1 + mid + 1),
                      vector<int>(g2, g2 + r - l + 1)),
              h = mul(vector<int>(f0 + l, f0 + mid + 1),
                      vector<int>(g1, g1 + r - l + 1));
  for (int i = mid + 1; i <= r; i++)
    f0[i] = (1ull * f0[i] + x[i - l] + y[i - l]) % p,
    f1[i] = (1ull * f1[i] + t[i - l] + h[i - l]) % p,
    f2[i] = (1ull * f2[i] + y[i - l] + z[i - l]) % p;
  solve(mid + 1, r);
}
int main() {
  int n;
  scanf("%d", &n);
  g[0] = g[2] = 1;
  for (int i = 4; i <= n; i++) g[i] = mod(g[i - 2] + g[i - 4]);
  for (int i = 1; i <= n; i++)
    g0[i] = 1ll * (i - 1) * (i - 1) * g[i - 1] % p, f0[i] = g0[i];
  for (int i = 2; i <= n; i++)
    g1[i] = 1ll * (i - 1) * (i - 1) * g[i - 2] % p, f1[i] = g1[i];
  for (int i = 3; i <= n; i++)
    g2[i] = 1ll * (i - 1) * (i - 1) * g[i - 3] % p, f2[i] = g2[i];
  init(n << 2);
  solve(1, n);
  int ans = 1ull * n * (g0[n] + g2[n]) % p;
  for (int i = 2; i <= n - 2; i++)
    ans = (ans + (1ull * g0[i] * f0[n - i] + 2ull * g1[i] * f1[n - i] +
                  1ull * g2[i] * f2[n - i]) %
                     p * i) %
          p;
  printf("%d", ans);
  return 0;
}
