#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5, mod = 1e6 + 3, inf = 0x3f3f3f3f;
template <class T>
T QuickMod(T a, T b, T c) {
  T ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % c;
    b >>= 1;
    a = (a * a) % c;
  }
  return ans;
}
template <class T>
T Gcd(T a, T b) {
  return b != 0 ? Gcd(b, a % b) : a;
}
template <class T>
T Lcm(T a, T b) {
  return a / Gcd(a, b) * b;
}
template <class T>
void outln(T x) {
  cout << x << endl;
}
int n, s = 1;
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    s *= 3;
    s %= 1000003;
  }
  cout << s << endl;
  return 0;
}
