#include <bits/stdc++.h>
inline long long mpow(long long x, int y = 998244353 - 2) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % 998244353;
    x = x * x % 998244353;
    y >>= 1;
  }
  return ans;
}
const long long invG = mpow(3);
int tr[200039], n, m, k, x, y, z;
long long f0[200039], f1[200039], f2[200039], g[200039], a[200039], b[200039],
    ans;
inline void make(int x) {
  for (int i = 0; i < x; i++)
    tr[i] = (tr[i >> 1] >> 1) | ((i & 1) ? x >> 1 : 0);
}
inline void swap(long long &x, long long &y) { x ^= y ^= x ^= y; }
inline void ntt(long long *f, int n, int flag) {
  register int i, j, k;
  long long pus, now, key;
  for (i = 0; i < n; i++)
    if (i < tr[i]) swap(f[i], f[tr[i]]);
  for (i = 2; i <= n; i <<= 1) {
    for (key = mpow(flag ? 3 : invG, (998244353 - 1) / i), j = 0; j < n;
         j += i) {
      for (pus = 1, k = j; k < j + i / 2; k++)
        now = f[k + i / 2] * pus % 998244353,
        f[k + i / 2] = (f[k] - now + 998244353) % 998244353,
        f[k] = (f[k] + now) % 998244353, pus = pus * key % 998244353;
    }
  }
}
using namespace std;
inline void solve(int l, int r) {
  if (l == r) {
    f0[l] = (f0[l] + g[l] * l % 998244353 * l) % 998244353;
    f1[l] = (f1[l] + g[l] * (l + 1) % 998244353 * (l + 1)) % 998244353;
    f2[l] = (f2[l] + g[l] * (l + 2) % 998244353 * (l + 2)) % 998244353;
    return;
  }
  int mid = l + r >> 1, m = (r - l + 1) << 1, i, invn = mpow(m);
  solve(l, mid);
  make(m);
  for (i = 0; i < m; i++) a[i] = b[i] = 0;
  for (i = 0; i <= mid - l; i++) a[i] = f0[l + i];
  for (i = 0; i <= r - l; i++) b[i] = g[i] * i % 998244353 * i % 998244353;
  for (ntt(a, m, 1), ntt(b, m, 1), i = 0; i < m; i++)
    a[i] = a[i] * b[i] % 998244353;
  for (ntt(a, m, 0), i = mid - l; i < r - l; i++)
    f0[l + i + 1] = (f0[l + i + 1] + a[i] * invn) % 998244353;
  for (i = 0; i < m; i++) a[i] = b[i] = 0;
  for (i = 0; i <= mid - l; i++) a[i] = f1[l + i];
  for (i = 0; i <= r - l; i++)
    b[i] = g[i] * (i + 1) % 998244353 * (i + 1) % 998244353;
  for (ntt(a, m, 1), ntt(b, m, 1), i = 0; i < m; i++)
    a[i] = a[i] * b[i] % 998244353;
  for (ntt(a, m, 0), i = mid - l; i < r - l; i++)
    f2[l + i + 1] = (f2[l + i + 1] + a[i] * invn) % 998244353;
  for (i = ((mid - l - 2) > (0) ? (mid - l - 2) : (0)); i < r - l - 2; i++)
    f0[l + i + 3] = (f0[l + i + 3] + a[i] * invn) % 998244353;
  for (i = 0; i < m; i++) a[i] = b[i] = 0;
  for (i = 0; i <= mid - l; i++) a[i] = f0[l + i];
  for (i = 0; i <= r - l; i++)
    b[i] = g[i] * (i + 1) % 998244353 * (i + 1) % 998244353;
  for (ntt(a, m, 1), ntt(b, m, 1), i = 0; i < m; i++)
    a[i] = a[i] * b[i] % 998244353;
  for (ntt(a, m, 0), i = mid - l; i < r - l; i++)
    f1[l + i + 1] = (f1[l + i + 1] + a[i] * invn) % 998244353;
  for (i = 0; i < m; i++) a[i] = b[i] = 0;
  for (i = 0; i <= mid - l; i++) a[i] = f1[l + i];
  for (i = 0; i <= r - l; i++)
    b[i] = g[i] * (i + 2) % 998244353 * (i + 2) % 998244353;
  for (ntt(a, m, 1), ntt(b, m, 1), i = 0; i < m; i++)
    a[i] = a[i] * b[i] % 998244353;
  for (ntt(a, m, 0), i = ((mid - l - 2) > (0) ? (mid - l - 2) : (0));
       i < r - l - 2; i++)
    f1[l + i + 3] = (f1[l + i + 3] + a[i] * invn) % 998244353;
  for (i = 0; i < m; i++) a[i] = b[i] = 0;
  for (i = 0; i <= mid - l; i++) a[i] = f2[l + i];
  for (i = 0; i <= r - l; i++)
    b[i] = g[i] * (i + 2) % 998244353 * (i + 2) % 998244353;
  for (ntt(a, m, 1), ntt(b, m, 1), i = 0; i < m; i++)
    a[i] = a[i] * b[i] % 998244353;
  for (ntt(a, m, 0), i = ((mid - l - 2) > (0) ? (mid - l - 2) : (0));
       i < r - l - 2; i++)
    f2[l + i + 3] = (f2[l + i + 3] + a[i] * invn) % 998244353;
  solve(mid + 1, r);
}
int main() {
  register int i;
  scanf("%d", &n);
  for (m = 1; m < n; m <<= 1)
    ;
  g[0] = 1;
  g[2] = 1;
  for (i = 4; i <= m; i++) g[i] = (g[i - 2] + g[i - 4]) % 998244353;
  solve(0, m - 1);
  ans = n * (g[n - 1] + g[n - 3]) % 998244353 * (n - 1) % 998244353 * (n - 1) %
        998244353;
  for (i = 2; i <= n - 2; i++)
    ans =
        (ans + (g[i - 1] * f0[n - i - 1] + 2 * g[i - 2] * f1[n - i - 2] +
                (i ^ 2 && i ^ (n - 2)) * g[i - 3] * f2[n - i - 3]) %
                   998244353 * i % 998244353 * (i - 1) % 998244353 * (i - 1)) %
        998244353;
  printf("%lld\n", ans);
}
