#include <bits/stdc++.h>
using namespace std;
int main() {
  const long long MOD = 1000003;
  int n;
  cin >> n;
  long long g = 1;
  for (int i = 1; i < n; i++) {
    g = (g * 3) % MOD;
  }
  cout << g;
}
