#include <bits/stdc++.h>
using namespace std;
const int mod = 1e6 + 3;
int main() {
  int n;
  unsigned long long int ans = 1, INF = 2e1000;
  cin >> n;
  n--;
  for (int i = 0; i < n; i++) {
    ans *= 3;
    ans %= mod;
  }
  cout << ans % mod << endl;
  return 0;
}
