#include <bits/stdc++.h>
using namespace std;
int dp[1005];
void input() {
  int i, n;
  scanf("%d", &n);
  dp[0] = dp[1] = 1;
  for ((i) = (2); (i) <= (n); (i)++) dp[i] = (dp[i - 1] * 3) % 1000003;
  printf("%d", dp[n]);
}
int main() {
  input();
  return 0;
}
