#include <bits/stdc++.h>
using namespace std;
const int maxn = 50050, mod = 998244353;
inline long long read() {
  char ch = getchar();
  long long x = 0, f = 0;
  while (ch < '0' || ch > '9') f |= ch == '-', ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return f ? -x : x;
}
int n, f[maxn][2][2][2][2][2], g[maxn][2][2][2][2][2];
void work(int f[][2][2][2][2][2]) {
  for (int i = (0); i <= (n - 2); i++)
    for (int a = (0); a <= (1); a++)
      for (int b = (0); b <= (1); b++)
        for (int c = (0); c <= (1); c++)
          for (int d = (0); d <= (1); d++)
            for (int e = (0); e <= (1); e++) {
              if (b) {
                if (!a) {
                  for (int x = (c); x <= (1); x++)
                    for (int y = (d); y <= (1); y++)
                      for (int z = (e); z <= (1); z++)
                        f[i + 1][1][1][x][y][z] =
                            (f[i + 1][1][1][x][y][z] + f[i][a][b][c][d][e]) %
                            mod;
                }
                for (int x = (c); x <= (1); x++)
                  for (int y = (d); y <= (1); y++)
                    for (int z = (e); z <= (1); z++)
                      f[i + 1][0][a][x][y][z] =
                          (f[i + 1][0][a][x][y][z] + f[i][a][b][c][d][e]) % mod;
                if (c && d && !e)
                  f[i + 1][1][a][0][0][0] =
                      (f[i + 1][1][a][0][0][0] + f[i][a][b][c][d][e]) % mod;
              } else {
                for (int x = (c); x <= (1); x++)
                  for (int y = (d); y <= (1); y++)
                    for (int z = (e); z <= (1); z++)
                      f[i + 1][1][a][x][y][z] =
                          (f[i + 1][1][a][x][y][z] + f[i][a][b][c][d][e]) % mod;
              }
            }
}
int main() {
  n = read();
  f[0][1][1][0][0][0] = 1;
  work(f);
  g[0][1][0][0][0][0] = 1;
  work(g);
  int fs = (f[n - 1][1][1][1][1][0] + f[n - 1][1][1][1][1][1]) % mod;
  int gs = (g[n - 1][0][1][1][1][0] + g[n - 1][0][1][1][1][1]) % mod;
  printf("%d\n", (fs + gs) % mod);
}
