#include <bits/stdc++.h>
using namespace std;
int MOD = 1000003;
int main() {
  int n;
  cin >> n;
  long long pow3 = 1;
  while (n > 1) {
    pow3 = (pow3 * 3) % MOD;
    --n;
  }
  cout << pow3 << endl;
}
