#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9;
const double EPS = (double)1e-9;
const double PI = (double)acos(-1.0);
const long long MOD = (long long)1e9 + 7;
void base() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  int n;
  long long pangkat[100005];
  pangkat[0] = 1;
  int MOD = 1e6 + 3;
  for (int i = 1; i <= 1005; i++) {
    pangkat[i] = (1LL * pangkat[i - 1] * 3) % MOD;
  }
  cin >> n;
  if (n == 0) n = 1;
  cout << pangkat[n - 1] % MOD << endl;
  return 0;
}
