#include <bits/stdc++.h>
using namespace std;
int n;
const int mod = 1e6 + 3;
char str[1000000 + 10];
int a[110][3];
int main() {
  while (~scanf("%d", &n)) {
    int sum = 1;
    for (int i = 0; i < n - 1; i++) {
      sum = (sum * 3) % mod;
    }
    printf("%d\n", sum);
  }
  return 0;
}
