#include <bits/stdc++.h>
using namespace std;
int n, ans, g, pc4;
int main() {
  scanf("%d", &n);
  ans = 2, g = 1, pc4 = 4;
  for (int i = 2; i < n; i += 2) {
    pc4 = (long long)pc4 * g % 1000000009;
    ans = ((long long)ans + pc4) % 1000000009;
    g = ((long long)g * 2 + 3) % 1000000009;
  }
  ans = ((long long)ans * ans * 2 + 2) % 1000000009;
  printf("%d\n", ans);
  return 0;
}
