#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int first = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) {
    if (ch == '-') f = -1;
  }
  for (; isdigit(ch); ch = getchar()) {
    first = first * 10 + ch - 48;
  }
  return first * f;
}
const int mxN = 1e5;
const int P = 998244353;
long long f[mxN + 3][4][2][5];
int n, io;
void updsum(long long &first, long long second) {
  first += second - P, first += (first >> 31) & P;
}
void DP() {
  for (int i = 1; i < n; i++) {
    io = i;
    for (int x1 = 0; x1 < 4; x1++)
      for (int x2 = 0; x2 < 2; x2++) {
        for (int Lorem_ipsum_ = 0; Lorem_ipsum_ < 4; Lorem_ipsum_++)
          if ((Lorem_ipsum_ & x1) == x1) {
            updsum(f[i][Lorem_ipsum_][x2][1], f[i - 1][x1][x2][0]);
            updsum(f[i][Lorem_ipsum_][x2][0], f[i - 1][x1][x2][1]);
            updsum(f[i][Lorem_ipsum_][x2][3], f[i - 1][x1][x2][1]);
            updsum(f[i][Lorem_ipsum_][x2][0], f[i - 1][x1][x2][2]);
            updsum(f[i][Lorem_ipsum_][x2][4], f[i - 1][x1][x2][3]);
            updsum(f[i][Lorem_ipsum_][x2][0], f[i - 1][x1][x2][4]);
          }
      }
    for (int x2 = 0; x2 < 2; x2++) {
      long long coe = x2 == 0 ? i : 1ll;
      updsum(f[i][0][1][2], f[i - 1][3][x2][1] * coe % P);
      updsum(f[i][0][1][0], f[i - 1][3][x2][0] * coe % P);
    }
  }
}
int main() {
  n = read();
  long long ans = 0ll;
  if (n == 1) {
    puts("0");
    return 0;
  }
  memset(f, 0, sizeof(f));
  f[0][0][0][0] = 1ll;
  DP();
  updsum(ans, f[n - 1][3][0][0] * n % P);
  updsum(ans, f[n - 1][3][1][0]);
  memset(f, 0, sizeof(f));
  f[0][0][0][2] = 1ll;
  DP();
  updsum(ans, f[n - 1][3][0][1] * n % P);
  updsum(ans, f[n - 1][3][1][1]);
  printf("%lld\n", ans);
  return 0;
}
