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