#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e6 + 3;
const long long N = 5e5;
const long long inf = 1e9 + 1;
long long n, res = 1;
int main() {
  cin >> n;
  n--;
  for (int i = 1; i <= n; ++i) {
    res = (res * 3) % Mod;
  }
  cout << res;
  return 0;
}
