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