#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  const int M = 1000003;
  cin >> n;
  int ans = 1;
  for (int i = 0; i < n - 1; ++i) ans = 3 * ans % M;
  cout << ans << '\n';
  return 0;
}
