#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  while (scanf("%d", &n) != EOF) {
    x = 1;
    n--;
    for (int i = 0; i < n; ++i) x = (x * 3) % 1000003;
    cout << x << endl;
  }
  return 0;
}
