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