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