#include <bits/stdc++.h>
int read() {
  int r = 0, t = 1, c = getchar();
  while (c < '0' || c > '9') {
    t = c == '-' ? -1 : 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    r = r * 10 + c - 48;
    c = getchar();
  }
  return r * t;
}
const int N = 100010, mod = 998244353;
long long &Add(long long &a, long long b) { return a = (a + b) % mod; }
long long f[N][8][10], ans, n, i;
void trans(int b, int a) {
  for (int x = (0), end_x = (7); x <= end_x; x++)
    for (int y = (0), end_y = (7); y <= end_y; y++)
      if ((x & y) == x) Add(f[i + 1][y][a], f[i][x][b]);
}
void Trans(int b, int a) { Add(f[i + 1][2][a], f[i][7][b]); }
void dp() {
  for (i = 1; i <= n - 1; i++) {
    trans(0, 6);
    Trans(0, 2);
    trans(1, 7);
    Trans(1, 3);
    trans(2, 1);
    trans(3, 0);
    trans(4, 6);
    Trans(4, 2);
    trans(5, 4);
    trans(6, 7);
    Trans(6, 3);
    trans(7, 5);
    for (int x = (0), end_x = (7); x <= end_x; x++)
      for (int y = (0), end_y = (7); y <= end_y; y++)
        for (int z = (0), end_z = (7); z <= end_z; z++)
          if ((x & y) == x && (y & z) == y)
            for (int op = (0), end_op = (7); op <= end_op; op++)
              if (op == 0 || op == 2 || op == 4)
                Add(f[i + 2][z][4], f[i][x][op]);
  }
}
int main() {
  n = read();
  memset(f, 0, sizeof(f));
  f[1][0][2] = f[1][2][2] = 1;
  dp();
  Add(ans, f[n][7][0] + f[n][7][4]);
  memset(f, 0, sizeof(f));
  f[1][0][3] = f[1][2][3] = 1;
  dp();
  Add(ans, f[n][7][1] + f[n][7][6]);
  printf("%lld\n", ans);
  return 0;
}
