#include <bits/stdc++.h>
using namespace std;
const int BUF_SIZE = 1 << 12;
char buf[BUF_SIZE], *buf_s = buf, *buf_t = buf + 1;
template <typename _n_>
void mian(_n_ &_x_) {
  while (*buf_s != '-' && !isdigit(*buf_s)) {
    buf_s++;
    if (buf_s == buf_t) {
      buf_s = buf;
      buf_t = buf + fread(buf, 1, BUF_SIZE, stdin);
    }
  };
  bool register _nega_ = false;
  if (*buf_s == '-') {
    _nega_ = true;
    {
      buf_s++;
      if (buf_s == buf_t) {
        buf_s = buf;
        buf_t = buf + fread(buf, 1, BUF_SIZE, stdin);
      }
    };
  }
  _x_ = 0;
  while (isdigit(*buf_s)) {
    _x_ = _x_ * 10 + *buf_s - '0';
    {
      buf_s++;
      if (buf_s == buf_t) {
        buf_s = buf;
        buf_t = buf + fread(buf, 1, BUF_SIZE, stdin);
      }
    };
  }
  if (_nega_) _x_ = -_x_;
}
const int32_t mod = 998244353;
const int32_t kato = 1e6 + 10;
template <typename _n_>
bool cmax(_n_ &a, const _n_ &b) {
  return a < b ? a = b, 1 : 0;
}
template <typename _n_>
bool cmin(_n_ &a, const _n_ &b) {
  return a > b ? a = b, 1 : 0;
}
int32_t n, len, ans, lim;
int32_t g[kato], G0[kato], G1[kato], G2[kato], F0[kato], F1[kato], F2[kato];
inline int32_t quick_pow(int32_t a, int32_t b) {
  int32_t res = 1;
  for (; b; b >>= 1, a = static_cast<int64_t>(a) * a % mod) {
    if (b & 1) {
      res = static_cast<int64_t>(res) * a % mod;
    }
  }
  return res;
}
inline void NTT(int32_t *y, int32_t len, int32_t opt) {
  int32_t *rev = new int32_t[len];
  rev[0] = 0;
  for (int32_t i = 1; i < len; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) * (len >> 1));
  for (int32_t i = 0; i < len; i++)
    if (rev[i] > i) swap(y[rev[i]], y[i]);
  for (int32_t i = 1; i < len; i <<= 1) {
    int32_t g1 = quick_pow(3, (mod - 1) / (i << 1));
    for (int32_t j = 0; j < len; j += (i << 1)) {
      for (int32_t k = 0, g = 1; k < i;
           k++, g = static_cast<int64_t>(g) * g1 % mod) {
        int32_t res = static_cast<int64_t>(y[i + j + k]) * g % mod;
        y[i + j + k] = ((y[j + k] - res) % mod + mod) % mod;
        y[j + k] = (y[j + k] + res) % mod;
      }
    }
  }
  if (opt == -1) {
    reverse(y + 1, y + len);
    for (int32_t i = 0, inv = quick_pow(len, mod - 2); i < len; i++)
      y[i] = static_cast<int64_t>(y[i]) * inv % mod;
  }
  delete[] rev;
  rev = 0x0;
}
inline void poly_mul(int32_t *a, int32_t r1, int32_t *b, int32_t r2, int32_t *c,
                     int32_t len) {
  int32_t len1 = r1 + r2 - 1;
  for (lim = 1; lim <= len1; lim <<= 1)
    ;
  int32_t *f = new int32_t[lim];
  int32_t *g = new int32_t[lim];
  for (int32_t i = 0; i < r1; i++) f[i] = a[i];
  for (int32_t i = r1; i < lim; i++) f[i] = 0;
  for (int32_t i = 0; i < r2; i++) g[i] = b[i];
  for (int32_t i = r2; i < lim; i++) g[i] = 0;
  NTT(f, lim, 1);
  NTT(g, lim, 1);
  for (int32_t i = 0; i < lim; i++)
    f[i] = static_cast<int64_t>(f[i]) * g[i] % mod;
  NTT(f, lim, -1);
  for (int32_t i = 0; i < len; i++) c[i] = f[i];
  delete[] f;
  f = 0x0;
  delete[] g;
  g = 0x0;
}
void CDQ(int32_t l, int32_t r) {
  if (l == r) {
    F0[l] = (F0[l] + G0[l]) % mod;
    F1[l] = (F1[l] + G1[l]) % mod;
    F2[l] = (F2[l] + G2[l]) % mod;
    return;
  }
  int32_t mid = (l + r) >> 1, len = r - l + 1;
  CDQ(l, mid);
  static int32_t res[kato];
  poly_mul(F0 + l, mid - l + 1, G0, len, res + l, len);
  for (int32_t i = mid + 1; i <= r; i++) F0[i] = (F0[i] + res[i]) % mod;
  poly_mul(F0 + l, mid - l + 1, G1, len, res + l, len);
  for (int32_t i = mid + 1; i <= r; i++) F1[i] = (F1[i] + res[i]) % mod;
  poly_mul(F1 + l, mid - l + 1, G1, len, res + l, len);
  for (int32_t i = mid + 1; i <= r; i++)
    F0[i] = (F0[i] + res[i]) % mod, F2[i] = (F2[i] + res[i]) % mod;
  poly_mul(F1 + l, mid - l + 1, G2, len, res + l, len);
  for (int32_t i = mid + 1; i <= r; i++) F1[i] = (F1[i] + res[i]) % mod;
  poly_mul(F2 + l, mid - l + 1, G2, len, res + l, len);
  for (int32_t i = mid + 1; i <= r; i++) F2[i] = (F2[i] + res[i]) % mod;
  CDQ(mid + 1, r);
}
inline int Ame_() {
  mian(n);
  g[0] = 1, g[1] = 0;
  for (int32_t i = 2; i <= n; i++) g[i] = (g[i - 2] + g[i - 4]) % mod;
  for (int32_t i = 1; i <= n; i++)
    G0[i] = static_cast<int64_t>(i - 1) * (i - 1) % mod * g[i - 1] % mod;
  for (int32_t i = 2; i <= n; i++)
    G1[i] = static_cast<int64_t>(i - 1) * (i - 1) % mod * g[i - 2] % mod;
  for (int32_t i = 3; i <= n; i++)
    G2[i] = static_cast<int64_t>(i - 1) * (i - 1) % mod * g[i - 3] % mod;
  CDQ(1, n);
  ans = static_cast<int64_t>(n) * (G0[n] + G2[n]) % mod;
  for (int32_t i = 2; i <= n - 2; i++)
    ans = (ans + (static_cast<int64_t>(G0[i]) * F0[n - i] % mod +
                  static_cast<int64_t>(2) * G1[i] % mod * F1[n - i] % mod +
                  static_cast<int64_t>(G2[i]) * F2[n - i] % mod) %
                     mod * i % mod) %
          mod;
  fprintf(stdout, "%d\n", ans);
  return ~~(0 ^ 0 ^ 0);
}
int Ame__ = Ame_();
int main() { ; }
