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