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