#include <bits/stdc++.h>
long long arr[100009];
long long brr[100009];
int arr2[100][100];
int M(int n) {
  if (n > 100)
    return (n - 10);
  else
    return (M(M(n + 11)));
}
unsigned long long n, sum = 1, x;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  std::ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  if (n == 0)
    cout << 1 << endl;
  else if (n == 1)
    cout << 1 << endl;
  else if (n == 2)
    cout << 3 << endl;
  else {
    n -= 1;
    while (n--) {
      sum *= 3;
      sum %= 1000003;
    }
    cout << sum << endl;
  }
}
