#include <bits/stdc++.h>
using namespace std;
int n;
long long dp[1005];
int mod = 1e6 + 3;
int main() {
  cin >> n;
  dp[0] = 1, dp[1] = 1;
  for (int i = 1; i < n; i++) {
    dp[i + 1] = dp[i] * 3 % mod;
  }
  cout << dp[n];
}
