#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n = 0, ans = 0, mod = 1e+9 + 9, Lev = 5, dob = 1;
  scanf("%I64d", &n);
  if (n == 2)
    ans = 10;
  else {
    for (int i = 5; i <= n; i += 2) {
      dob = (dob * Lev) % mod;
      ans = (ans + 4 * dob) % mod;
      Lev = (2 * Lev + 3) % mod;
    }
    ans = (2 * ((ans + 6) * (ans + 6) + mod - 4) + 10) % mod;
  }
  printf("%I64d\n", ans);
  return 0;
}
