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