#include <bits/stdc++.h>
int main() {
  long long int m, n = 1;
  scanf("%lld", &m);
  for (int i = 1; i < m; i++) {
    n = n * 3;
    n = n % 1000003;
  }
  if (m == 0)
    printf("1\n");
  else
    printf("%lld\n", n);
}
