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