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