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