#include <bits/stdc++.h>
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int sum = 1;
    for (int i = 1; i < n; i++) {
      sum *= 3;
      sum %= 1000003;
    }
    printf("%d\n", sum);
  }
  return 0;
}
