#include <bits/stdc++.h>
using namespace std;
const int maxN = 11000;
const long long mod = 1000003LL;
long long p2[maxN];
long long d[maxN];
int main() {
  p2[0] = 1;
  for (int i = 1; i < maxN; ++i) {
    p2[i] = (2LL * p2[i - 1]) % mod;
  }
  int n;
  cin >> n;
  if (n == 0) {
    cout << 1 << endl;
    return 0;
  }
  d[0] = 1;
  d[1] = 1;
  for (int i = 2; i <= n; ++i) {
    d[i] = 3 * d[i - 1];
    d[i] %= mod;
    d[i] = (d[i] + mod) % mod;
  }
  cout << d[n] << endl;
  return 0;
}
