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