#include <bits/stdc++.h>
using namespace std;
int n, i, j, x, temp;
int main() {
  scanf("%d", &n);
  n = n - 1;
  x = 1;
  for (i = 1; i <= n; i++) {
    x = x * 3;
    if (x > 1000003) x = x % 1000003;
  }
  x = x % 1000003;
  printf("%d", x);
  return 0;
}
