#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long ans = 0, op = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') op = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    (ans *= 10) += ch - '0';
    ch = getchar();
  }
  return ans * op;
}
const long long mod = 1000000009;
const int maxn = 1e6 + 10;
long long multp[maxn];
long long power(long long a, long long b) {
  long long ans = 1, res = a;
  while (b) {
    if (b & 1) (ans *= res) %= mod;
    (res *= res) %= mod;
    b >>= 1;
  }
  return ans;
}
long long s;
long long n;
int main() {
  n = read();
  multp[2] = 1;
  for (int i = 3; i <= n; i++)
    multp[i] = multp[i - 1] * (power(2, i) - 3) % mod;
  for (int i = 2; i <= n / 2; i++) (s += 4 * multp[i]) %= mod;
  printf("%lld", (10 + 8 * s + 2 * power(s, 2)) % mod);
}
