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