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