#include <bits/stdc++.h>
using namespace std;
int n, h[400005], g0[400005], g1[400005], g2[400005], Ans;
int h0[400005], h1[400005], h2[400005];
int sqr(int x) { return (long long)x * x % 998244353; }
void upd(int &x, int y) { x = (x + y) % 998244353; }
int pw(int x, int y) {
  int ans = 1;
  for (; y; x = (long long)x * x % 998244353, y >>= 1)
    if (y & 1) ans = (long long)ans * x % 998244353;
  return ans;
}
int tn, tl, r[400005], rn, w[2][400005], A[400005], B[400005], C[400005];
void dft(int a[], int p) {
  for (int i = 0; i < tn; i++)
    if (r[i] > i) swap(a[r[i]], a[i]);
  for (int i = 1; i < tn; i <<= 1)
    for (int j = 0, t = tn / (i << 1); j < tn; j += i << 1)
      for (int k = 0, l = 0; k < i; k++, l += t) {
        int x = (long long)w[p][l] * a[j + k + i] % 998244353, y = a[j + k];
        a[j + k] = (y + x) % 998244353;
        a[j + k + i] = (y - x + 998244353) % 998244353;
      }
  if (p)
    for (int i = 0; i < tn; i++) a[i] = (long long)a[i] * rn % 998244353;
}
void pre(int n) {
  tn = 1, tl = 0;
  while (tn <= n) tn <<= 1, tl++;
  tn <<= 1;
  tl++;
  int W = pw(3, (998244353 - 1) / tn);
  w[0][0] = w[1][0] = 1;
  for (int i = 1; i < tn; i++)
    w[0][i] = w[1][tn - i] = (long long)w[0][i - 1] * W % 998244353;
  for (int i = 1; i < tn; i++) r[i] = (r[i >> 1] >> 1) | ((i & 1) << tl - 1);
  rn = pw(tn, 998244353 - 2);
}
void work(int l, int r, int a[], int b[], int c[]) {
  int len = r - l + 1, mid = l + r >> 1;
  for (int i = l; i <= mid; i++) A[i - l] = a[i];
  for (int i = mid + 1; i <= r; i++) A[i - l] = 0;
  for (int i = r + 1 - l; i < tn; i++) A[i] = 0;
  for (int i = 0; i <= len; i++) B[i] = b[i];
  for (int i = len + 1; i < tn; i++) B[i] = 0;
  dft(A, 0);
  dft(B, 0);
  for (int i = 0; i < tn; i++) C[i] = (long long)A[i] * B[i] % 998244353;
  dft(C, 1);
  for (int i = mid + 1; i <= r; i++) upd(c[i], C[i - l]);
}
void solve(int l, int r) {
  if (l == r) {
    upd(g0[l], (long long)h[l] * sqr(l) % 998244353);
    upd(g1[l], (long long)h[l - 1] * sqr(l) % 998244353);
    upd(g2[l], (long long)h[l - 2] * sqr(l) % 998244353);
    return;
  }
  int mid = l + r >> 1, len = r - l;
  solve(l, mid);
  pre(len);
  work(l, r, g0, h0, g0);
  work(l, r, g1, h0, g1);
  work(l, r, g1, h1, g2);
  work(l, r, g1, h1, g0);
  work(l, r, g2, h1, g1);
  work(l, r, g2, h2, g2);
  solve(mid + 1, r);
}
int main() {
  scanf("%d", &n);
  h[0] = 1;
  for (int i = 1; i <= n; i++)
    h[i] = ((i >= 2 ? h[i - 2] : 0) + (i >= 4 ? h[i - 4] : 0)) % 998244353;
  for (int i = 0; i <= n; i++) {
    h0[i + 1] = (long long)h[i] * sqr(i) % 998244353;
    h1[i + 2] = (long long)h[i] * sqr(i + 1) % 998244353;
    h2[i + 3] = (long long)h[i] * sqr(i + 2) % 998244353;
  }
  solve(0, n);
  upd(Ans, (long long)(n - 1) * h[n - 1] % 998244353 * sqr(n - 1) % 998244353);
  upd(Ans, (long long)(n - 1) * h[n - 3] % 998244353 * sqr(n - 1) % 998244353);
  upd(Ans, g0[n - 1]);
  upd(Ans, g2[n - 1]);
  for (int i = 3; i <= n; i++) {
    int tmp = 0;
    upd(tmp, (long long)h[i - 2] * g0[n - i] % 998244353);
    upd(tmp, (long long)h[i - 3] * g1[n - i] * 2 % 998244353);
    if (i >= 4) upd(tmp, (long long)h[i - 4] * g2[n - i] % 998244353);
    upd(Ans, (long long)(i - 2) * tmp % 998244353 * sqr(i - 2) % 998244353);
  }
  printf("%d\n", Ans);
}
