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