#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10, p = 119 << 23 | 1;
int inc(int x, int y) {
  x += y;
  return x >= p ? x - p : x;
}
int dec(int x, int y) {
  x -= y;
  return x < 0 ? x + p : x;
}
int mul(int x, int y) { return (long long)x * y % p; }
int power(int x, int y) {
  int ans = 1;
  for (; y; y >>= 1, x = mul(x, x))
    if (y & 1) ans = mul(ans, x);
  return ans;
}
int w[N], iw[N];
void init(int n) {
  w[0] = 1;
  w[1] = power(3, (p - 1) / n);
  for (int i = 2; i <= n; i++) w[i] = mul(w[i - 1], w[1]);
  for (int i = 0; i <= n; i++) iw[i] = w[n - i];
}
void fft(int n, int *a, int *w) {
  for (int i = 0, j = 0; i < n; i++) {
    if (i < j) swap(a[i], a[j]);
    for (int k = n >> 1; (j ^= k) < k; k >>= 1)
      ;
  }
  for (int i = 2; i <= n; i <<= 1) {
    int m = i >> 1, step = n / i;
    for (int j = 0; j < n; j += i)
      for (int k = 0, pos = 0; k < m; k++, pos += step) {
        int t = mul(a[j + k + m], w[pos]);
        a[j + k + m] = dec(a[j + k], t);
        a[j + k] = inc(a[j + k], t);
      }
  }
  if (w == iw) {
    int del = power(n, p - 2);
    for (int i = 0; i < n; i++) a[i] = mul(a[i], del);
  }
}
void getinv(int n, int *a, int *b) {
  if (n == 1) return void(b[0] = power(a[0], p - 2));
  getinv((n + 1) >> 1, a, b);
  static int tmp[N];
  int size = 1;
  while (size < n + n) size <<= 1;
  for (int i = 0; i < n; i++) tmp[i] = a[i];
  for (int i = n; i < size; i++) tmp[i] = 0;
  init(size);
  fft(size, tmp, w);
  fft(size, b, w);
  for (int i = 0; i < size; i++) b[i] = mul(b[i], dec(2, mul(b[i], tmp[i])));
  fft(size, b, iw);
  for (int i = n; i < size; i++) b[i] = 0;
}
int sqr(int x) { return mul(x, x); }
int n, f0[N], f1[N], f2[N], g[N], g0[N], g1[N], g2[N], inv[N], frac[N];
int A[N], B[N], C[N], D[N], E[N], F[N];
int main() {
  scanf("%d", &n);
  g[0] = g[2] = 1;
  for (int i = 4; i <= n; i += 2) g[i] = inc(g[i - 2], g[i - 4]);
  for (int i = 0; i <= n; i++) {
    g0[i] = mul(g[i], sqr(i));
    g1[i] = mul(g[i], sqr(i + 1));
    g2[i] = mul(g[i], sqr(i + 2));
  }
  int size = 1;
  while (size < 4 * n) size <<= 1;
  init(size);
  for (int i = 0; i <= n; i++) {
    A[i] = (i < 3 ? 0 : g2[i - 3]);
    B[i] = (i < 1 ? 0 : g0[i - 1]);
    C[i] = g1[i];
    E[i] = g0[i];
  }
  A[0] = dec(A[0], 1);
  B[0] = dec(B[0], 1);
  fft(size, C, w);
  for (int i = 0; i < size; i++) D[i] = sqr(C[i]);
  fft(size, D, iw);
  for (int i = n + 1; i < size; i++) D[i] = 0;
  for (int i = 4; i <= n; i++) F[i] = D[i - 4];
  for (int i = n; i >= 0; i--) D[i] = (i >= 3 ? D[i - 3] : 0);
  fft(size, A, w);
  fft(size, B, w);
  fft(size, F, w);
  for (int i = 0; i < size; i++) frac[i] = dec(mul(A[i], B[i]), F[i]);
  fft(size, frac, iw);
  for (int i = n + 1; i < size; i++) frac[i] = 0;
  getinv(n + 1, frac, inv);
  init(size);
  fft(size, inv, w);
  for (int i = 0; i < size; i++) f1[i] = mul(inv[i], C[i]);
  fft(size, f1, iw);
  fft(size, E, w);
  fft(size, D, w);
  for (int i = 0; i < size; i++)
    f0[i] = mul(inv[i], dec(D[i], mul(E[i], A[i])));
  fft(size, f0, iw);
  for (int i = n + 1; i < size; i++) f0[i] = f1[i] = 0;
  for (int i = 0; i < size; i++) A[i] = B[i] = C[i] = inv[i] = 0;
  for (int i = 0; i <= n; i++) {
    A[i] = g2[i];
    B[i] = (i < 1 ? 0 : g1[i - 1]);
    C[i] = (i < 3 ? 0 : dec(0, g2[i - 3]));
  }
  C[0] = inc(C[0], 1);
  getinv(n + 1, C, inv);
  init(size);
  fft(size, A, w);
  fft(size, B, w);
  fft(size, f1, w);
  fft(size, inv, w);
  for (int i = 0; i < size; i++)
    f2[i] = mul(inc(A[i], mul(B[i], f1[i])), inv[i]);
  fft(size, f1, iw);
  fft(size, f2, iw);
  int ans = mul(mul(inc(g[n - 1], g[n - 3]), sqr(n - 1)), n);
  for (int i = 2; i <= n - 2; i++) {
    ans = inc(ans, mul(mul(g[i - 1], sqr(i - 1)), mul(f0[n - i - 1], i)));
    ans = inc(ans, mul(mul(g[i - 2], sqr(i - 1)), mul(f1[n - i - 2], i * 2)));
    if (i >= 3 && i <= n - 3)
      ans = inc(ans, mul(mul(g[i - 3], sqr(i - 1)), mul(f2[n - i - 3], i)));
  }
  printf("%d\n", ans);
  return 0;
}
