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