#include <bits/stdc++.h>
using namespace std;
long long a = 2, b = 2, c = 4, n;
int main() {
  for (cin >> n; n >= 4; n -= 2) {
    a = a * 2 % 1000000009;
    c = c * (a - 3) % 1000000009;
    b = (b + c) % 1000000009;
  }
  cout << (b * b + 1) * 2 % 1000000009 << endl;
  return 0;
}
