#include <bits/stdc++.h>
int n;
long long work() {
  long long a, b, c;
  a = 1, b = 2, c = 4;
  while (n -= 2) {
    c = c * a % 1000000009;
    b = (b + c) % 1000000009;
    a = (a * 2 + 3) % 1000000009;
  }
  return (b * b + 1) * 2 % 1000000009;
}
int main() {
  scanf("%d", &n);
  printf("%lld\n", work());
}
