#include <bits/stdc++.h>
using namespace std;
const int mo = 998244353;
const int gx = 3;
const int N = 1e6;
int Sum(int x, int y) {
  x += y;
  return (x > mo) ? x - mo : x;
}
int Sub(int x, int y) {
  x -= y;
  return (x < 0) ? x + mo : x;
}
int Mul(int x, int y) { return (long long)x * y % mo; }
int Pow(int x, long long y) {
  int z = 1;
  while (y) {
    if (y & 1) z = Mul(z, x);
    y >>= 1;
    x = Mul(x, x);
  }
  return z;
}
vector<int> f0, f1, f2, g0, g1, g2;
int n, F[N + 10];
namespace conv {
int rev[N + 10], wx[N + 10], lst = 1;
void Pre(int n) {
  rev[0] = 0;
  for (int i = 1; i < n; i++)
    if (i & 1)
      rev[i] = rev[i ^ 1] + (n >> 1);
    else
      rev[i] = rev[i >> 1] >> 1;
  for (; lst < n; lst <<= 1) {
    int wn = Pow(gx, (mo - 1) / (lst << 1));
    for (int i = lst, w = 1; i < (lst << 1); i++, w = Mul(w, wn)) wx[i] = w;
  }
}
void Dft(int *a, int n) {
  Pre(n);
  for (int i = 0; i < n; i++)
    if (rev[i] < i) swap(a[i], a[rev[i]]);
  for (int i = 2; i <= n; i <<= 1)
    for (int j = 0; j < n; j += i) {
      int *l = a + j, *r = a + j + i / 2, *now = wx + i / 2;
      for (int k = 0; k < i / 2; k++, l++, r++, now++) {
        int va = *l, nowx = Mul(*r, *now);
        *l = Sum(va, nowx);
        *r = Sub(va, nowx);
      }
    }
}
void Idft(int *a, int n) {
  Dft(a, n);
  reverse(a + 1, a + n);
  int invn = Pow(n, mo - 2);
  for (int i = 0; i < n; i++) a[i] = Mul(a[i], invn);
}
}  // namespace conv
namespace polys {
int ax[N + 10], bx[N + 10];
vector<int> operator+(vector<int> p, vector<int> q) {
  int sz = max(p.size(), q.size());
  p.resize(sz);
  for (int i = 0; i < sz; i++)
    if (i < (int)q.size()) p[i] = Sum(p[i], q[i]);
  return p;
}
vector<int> operator+(vector<int> p, int x) {
  p[0] = Sum(p[0], x);
  return p;
}
vector<int> operator-(vector<int> p, vector<int> q) {
  int sz = max(p.size(), q.size());
  p.resize(sz);
  for (int i = 0; i < sz; i++)
    if (i < (int)q.size()) p[i] = Sub(p[i], q[i]);
  return p;
}
vector<int> operator*(vector<int> p, int x) {
  for (int i = 0; i < (int)p.size(); i++) p[i] = Mul(p[i], x);
  return p;
}
vector<int> operator*(vector<int> p, vector<int> q) {
  int sz = p.size() + q.size() - 1;
  int nx = 1;
  while (nx < sz) nx <<= 1;
  for (int i = 0; i < nx; i++) ax[i] = bx[i] = 0;
  for (int i = 0; i < (int)p.size(); i++) ax[i] = p[i];
  for (int i = 0; i < (int)q.size(); i++) bx[i] = q[i];
  conv::Dft(ax, nx);
  conv::Dft(bx, nx);
  for (int i = 0; i < nx; i++) ax[i] = Mul(ax[i], bx[i]);
  conv::Idft(ax, nx);
  p.clear();
  for (int i = 0; i < sz; i++) p.push_back(ax[i]);
  return p;
}
vector<int> Make(int x) {
  vector<int> now;
  now.clear();
  now.push_back(x);
  return now;
}
}  // namespace polys
using namespace polys;
const int SZ = 2;
int nowa[SZ][SZ][N + 10], nowb[SZ][SZ][N + 10], nowc[SZ][SZ][N + 10];
struct matrix {
  vector<int> a[SZ][SZ];
  matrix operator*(matrix p) {
    matrix ans;
    int nx = 1;
    while (nx <= n * 2) nx <<= 1;
    for (int i = 0; i < SZ; i++)
      for (int j = 0; j < SZ; j++)
        for (int k = 0; k < nx; k++) {
          nowa[i][j][k] = nowb[i][j][k] = nowc[i][j][k] = 0;
          if (k < (int)a[i][j].size()) nowa[i][j][k] = a[i][j][k];
          if (k < (int)p.a[i][j].size()) nowb[i][j][k] = p.a[i][j][k];
        }
    for (int i = 0; i < SZ; i++)
      for (int j = 0; j < SZ; j++) {
        conv::Dft(nowa[i][j], nx);
        conv::Dft(nowb[i][j], nx);
      }
    for (int i = 0; i < SZ; i++)
      for (int j = 0; j < SZ; j++)
        for (int k = 0; k < SZ; k++)
          for (int k2 = 0; k2 < nx; k2++)
            nowc[i][k][k2] =
                Sum(nowc[i][k][k2], Mul(nowa[i][j][k2], nowb[j][k][k2]));
    for (int i = 0; i < SZ; i++)
      for (int j = 0; j < SZ; j++) conv::Idft(nowc[i][j], nx);
    for (int i = 0; i < SZ; i++)
      for (int j = 0; j < SZ; j++) {
        ans.a[i][j].clear();
        for (int k = 0; k <= n; k++) ans.a[i][j].push_back(nowc[i][j][k]);
      }
    return ans;
  }
  matrix operator+(matrix p) {
    for (int i = 0; i < SZ; i++)
      for (int j = 0; j < SZ; j++) p.a[i][j] = p.a[i][j] + a[i][j];
    return p;
  }
} trans, vv, v, I, nowx;
void Mpow(int y) {
  if (y == 1) {
    vv = nowx = trans;
    return;
  }
  Mpow(y / 2);
  vv = vv * nowx + vv;
  nowx = nowx * nowx;
  if (y & 1) {
    nowx = nowx * trans;
    vv = vv + nowx;
  }
}
void Prework() {
  F[0] = F[2] = 1;
  F[1] = F[3] = 0;
  for (int i = 4; i <= N; i++) F[i] = Sum(F[i - 2], F[i - 4]);
  f0.clear();
  f1.clear();
  f2.clear();
  f0.push_back(0);
  for (int i = 0; i <= n - 1; i++) f0.push_back(Mul(Mul(i, i), F[i]));
  f1.push_back(0);
  f1.push_back(0);
  for (int i = 0; i <= n - 2; i++) f1.push_back(Mul(Mul(i + 1, i + 1), F[i]));
  f2.push_back(0);
  f2.push_back(0);
  f2.push_back(0);
  for (int i = 0; i <= n - 3; i++) f2.push_back(Mul(Mul(i + 2, i + 2), F[i]));
  g0.clear();
  g1.clear();
  g2.clear();
  g0.push_back(0);
  for (int i = 0; i <= n - 1; i++)
    g0.push_back(Mul(Mul(i, i), Mul(i + 1, F[i])));
  g1.push_back(0);
  g1.push_back(0);
  for (int i = 0; i <= n - 2; i++)
    g1.push_back(Mul(Mul(Mul(i + 1, i + 1), i + 2), F[i]));
  g2.push_back(0);
  g2.push_back(0);
  g2.push_back(0);
  for (int i = 0; i <= n - 3; i++)
    g2.push_back(Mul(Mul(Mul(i + 2, i + 2), i + 3), F[i]));
  trans.a[0][0] = f0;
  trans.a[1][0] = trans.a[0][1] = f1;
  trans.a[1][1] = f2;
  Mpow(n - 1);
}
int Solve1() {
  int ans = g0[n];
  v.a[1][0] = v.a[1][1] = Make(0);
  v.a[0][0] = g0;
  v.a[0][1] = g1;
  v = v * vv;
  ans = Sum(ans, v.a[0][0][n]);
  return ans;
}
int Solve2() {
  int ans = g2[n];
  v.a[1][0] = v.a[1][1] = Make(0);
  v.a[0][0] = g1;
  v.a[0][1] = g2;
  v = v * vv;
  ans = Sum(ans, v.a[0][1][n]);
  return ans;
}
int main() {
  I.a[0][0] = I.a[1][1] = Make(1);
  I.a[1][0] = I.a[0][1] = Make(0);
  scanf("%d", &n);
  Prework();
  int ans = Solve1();
  ans = Sum(ans, Solve2());
  printf("%d\n", ans);
  return 0;
}
