#include <bits/stdc++.h>
long long mod = 1000003LL;
int main() {
  long long n, i;
  scanf("%I64d", &n);
  long long res = 1LL;
  for (i = 2; i <= n; ++i) {
    res = (res * 3) % mod;
  }
  printf("%I64d\n", res);
  return 0;
}
