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