#include <bits/stdc++.h>
using namespace std;
int mod = 1e6 + 3;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  if (n == 0)
    cout << "1\n";
  else {
    int ans = 1;
    for (int i = 1; i < n; ++i) {
      ans = (ans * 3) % mod;
    }
    cout << ans << "\n";
  }
  return 0;
}
