#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  scanf("%d", &n);
  long long pow = 2, mul = 4, sig = 0;
  while (n -= 2) {
    pow = (pow << 1) % 1000000009;
    mul = mul * (pow - 3) % 1000000009;
    sig = (sig + mul) % 1000000009;
  }
  long long ans = (2 * sig * sig + 8 * sig + 10) % 1000000009;
  if (ans < 0) ans += 1000000009;
  printf("%lld", ans);
}
