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