#include <bits/stdc++.h>
using namespace std;
const int NMAX = 105;
int N, ans = 1, i = 1;
int main() {
  cin >> N;
  for (int i = 1; i <= N - 1; ++i) ans = (3 * ans) % 1000003;
  cout << ans << endl;
  return 0;
}
