#include <bits/stdc++.h>
using namespace std;
int MAX(int a, int b) { return (a > b) ? a : b; }
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
void swop(int &a, int &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
int main() {
  int n, i;
  unsigned long long int rez = 1;
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    rez = (rez * 3) % 1000003;
  }
  cout << rez;
  return 0;
}
