#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n[1001], k, mod = 1000000 + 3;
  cin >> k;
  n[0] = n[1] = 1;
  for (int i = 2; i <= k; i++) n[i] = n[i - 1] * 3, n[i] %= mod;
  cout << n[k];
  return 0;
}
