#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353, G = 3, ig = 332748118;
inline int add(int a, int b) {
  if ((a += b) >= mod) a -= mod;
  return a;
}
inline int mult(int a, int b) {
  long long t = 1ll * a * b;
  if (t >= mod) t %= mod;
  return t;
}
inline int dec(int a, int b) {
  if ((a -= b) < 0) a += mod;
  return a;
}
inline int power(int a, int b) {
  int out = 1;
  while (b) {
    if (b & 1) out = mult(out, a);
    a = mult(a, a);
    b >>= 1;
  }
  return out;
}
inline int sqr(int x) { return mult(x, x); }
int n;
int g[262150], f0[262150], f1[262150], f2[262150], tg0[262150], tg1[262150],
    tg2[262150], ng0[262150], ng1[262150], ng2[262150];
int R[262150], po[262150], iv[262150], buf0[262150], buf1[262150], buf2[262150],
    lg2[262150];
int tmp0[262150], tmp1[262150], tmp2[262150], b[5][262150];
void ntt(int *A, bool flag, int len, bool reinit) {
  int tmp = 1, cnt = 0;
  while (tmp < len) tmp <<= 1, cnt++;
  for (int i = 0; i < len; i++)
    R[i] = (R[i >> 1] >> 1) | ((i & 1) << (cnt - 1));
  for (int i = 0; i < len; i++)
    if (i < R[i]) swap(A[i], A[R[i]]);
  for (int j = 1; j < len; j <<= 1) {
    int bas = po[j << 1];
    if (flag == 1) bas = iv[j << 1];
    for (int i = 0; i < len; i += (j << 1)) {
      int t = 1;
      for (int k = 0; k < j; k++, t = mult(t, bas)) {
        int nx = A[i + k], ny = mult(A[i + k + j], t);
        A[i + k] = add(nx, ny);
        A[i + k + j] = dec(nx, ny);
      }
    }
  }
  if (flag) {
    int I = power(len, mod - 2);
    for (int i = 0; i < len; i++) {
      A[i] = mult(A[i], I);
    }
  }
}
void solve(int l, int r) {
  if (l == r) return;
  int mid = (l + r) >> 1;
  solve(l, mid);
  copy(f0 + l, f0 + mid + 1, buf0 + l);
  copy(f1 + l, f1 + mid + 1, buf1 + l);
  copy(f2 + l, f2 + mid + 1, buf2 + l);
  copy(ng0, ng0 + r - l, tg0);
  copy(ng1, ng1 + r - l, tg1);
  copy(ng2, ng2 + r - l, tg2);
  int tlen = 1;
  while (tlen < r - l + 1) tlen <<= 1;
  tlen <<= 1;
  ntt(buf0 + l, 0, tlen, 1);
  ntt(buf1 + l, 0, tlen, 0);
  ntt(buf2 + l, 0, tlen, 0);
  ntt(tg0, 0, tlen, 0);
  ntt(tg1, 0, tlen, 0);
  ntt(tg2, 0, tlen, 0);
  for (int i = l; i < l + tlen; i++) {
    b[0][i] = mult(buf0[i], tg0[i - l]);
    b[1][i] = mult(buf1[i], tg1[i - l]);
    b[2][i] = mult(buf0[i], tg1[i - l]);
    b[3][i] = mult(buf1[i], tg2[i - l]);
    b[4][i] = mult(buf2[i], tg2[i - l]);
  }
  for (int i = 0; i < 5; i++) ntt(b[i] + l, 1, tlen, 0);
  fill(tg0, tg0 + tlen, 0);
  fill(tg1, tg1 + tlen, 0);
  fill(tg2, tg2 + tlen, 0);
  fill(buf0 + l, buf0 + l + tlen, 0);
  fill(buf1 + l, buf1 + l + tlen, 0);
  fill(buf2 + l, buf2 + l + tlen, 0);
  for (int i = max(mid, l); i < r; i++) {
    f0[i + 1] = add(f0[i + 1], b[0][i]);
    f1[i + 1] = add(f1[i + 1], b[2][i]);
    f2[i + 1] = add(f2[i + 1], b[1][i]);
  }
  for (int i = max(mid - 2, l); i <= r - 3; i++) {
    f0[i + 3] = add(f0[i + 3], b[1][i]);
    f1[i + 3] = add(f1[i + 3], b[3][i]);
    f2[i + 3] = add(f2[i + 3], b[4][i]);
  }
  for (int i = 0; i < 5; i++) fill(b[i] + l, b[i] + l + tlen, 0);
  solve(mid + 1, r);
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= 262144; i++) lg2[i] = lg2[i >> 1] + 1;
  po[0] = 1;
  iv[0] = 1;
  for (int i = 1; i < 262144; i++)
    po[i] = power(G, (mod - 1) / i), iv[i] = power(ig, (mod - 1) / i);
  g[0] = 1;
  g[1] = 0;
  g[2] = 1;
  g[3] = 0;
  for (int i = 4; i <= n; i++) g[i] = add(g[i - 2], g[i - 4]);
  for (int i = 0; i <= n; i++) {
    ng0[i] = f0[i] = mult(g[i], sqr(i));
    ng1[i] = f1[i] = mult(g[i], sqr(i + 1));
    ng2[i] = f2[i] = mult(g[i], sqr(i + 2));
  }
  solve(0, n);
  int ans = mult(n, mult(g[n - 1], mult(n - 1, n - 1)));
  if (n >= 3) ans = add(ans, mult(n, mult(g[n - 3], mult(n - 1, n - 1))));
  for (int i = 2; i <= n; i++) {
    int tmp = mult(mult(g[i - 2], sqr(i - 2)), f0[n - i]);
    if (i > 2 && i < n) {
      tmp = add(tmp, mult(mult(g[i - 3], sqr(i - 2)), mult(2, f1[n - i - 1])));
      if (i > 3 && i < n - 1)
        tmp = add(tmp, mult(mult(g[i - 4], sqr(i - 2)), f2[n - i - 2]));
    }
    ans = add(ans, mult(tmp, i - 1));
  }
  printf("%d\n", ans);
  return 0;
}
