#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int INF = 0x3f3f3f3f;
const int iinf = 1 << 30;
const long long linf = 2e18;
const int MOD = 1000000009;
const double eps = 1e-7;
void print(int x) {
  cout << x << endl;
  exit(0);
}
void PRINT(string x) {
  cout << x << endl;
  exit(0);
}
void douout(double x) { printf("%lf\n", x + 0.0000000001); }
signed main() {
  long long ans = 2, n, tip1 = 1, tip2 = 1;
  scanf("%lld", &n);
  n /= 2;
  if (n == 1) print(10);
  n--;
  while (n--) {
    ans = (ans + tip2 * 4) % MOD;
    tip1 = (tip1 * 2 + 3) % MOD;
    tip2 = (tip2 * tip1) % MOD;
  }
  ans = (ans * ans % MOD * 2 + 2) % MOD;
  printf("%lld\n", ans);
}
