#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int answ = 1;
  for (int i = 1; i < n; ++i) {
    answ = (answ * 3) % 1000003;
  }
  cout << answ << endl;
  return 0;
}
