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