#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e4;
const int mod = 998244353;
int add(int ta, int tb) { return ta + tb >= mod ? ta + tb - mod : ta + tb; }
int sub(int ta, int tb) { return ta < tb ? ta - tb + mod : ta - tb; }
int n;
int F[20] = {0,        0,        4,        8,        mod - 1, 16,
             mod - 10, 4,        mod - 12, mod - 48, 26,      mod - 44,
             15,       mod - 16, mod - 4,  mod - 4,  mod - 1};
int ans[maxn + 5] = {0,         0,   0,  24,  4,        144, mod - 4, 348,
                     mod - 128, 240, 28, 188, mod - 68, 16,  0,       4};
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= min(i, 16); j++)
      ans[i] = add(ans[i], 1ll * ans[i - j] * F[j] % mod);
  printf("%d\n", ans[n]);
  return 0;
}
