#include <bits/stdc++.h>
using namespace std;
const int Mod = 1000003;
int N;
char S[2000];
bool Flag[2000][2000];
int F[2000][2000];
int DP(int X, int Y) {
  if (Y == N || Y < 0) return 0;
  if (X == N - 1) return Y ? 0 : 1;
  if (Flag[X][Y]) return F[X][Y];
  Flag[X][Y] = true;
  F[X][Y] = DP(X, Y + 1);
  if (S[X] == '0')
    F[X][Y] += DP(X + 2, Y - 1);
  else
    F[X][Y] += DP(X + 1, Y);
  return F[X][Y] %= Mod;
}
int main() {
  N = 0;
  char c;
  while (c = getchar(), c != -1 && c != 10) {
    if (c == '-') c = '+';
    if (c == '/') c = '*';
    if (c < '0' || c > '9')
      S[N++] = c;
    else if (!N || S[N - 1] < '0' || S[N - 1] > '9')
      S[N++] = '0';
  }
  for (int i = 0; i < N; i++)
    if (S[i] == '*' && (!i || S[i - 1] != '0')) {
      printf("0\n");
      return 0;
    }
  if (S[N - 1] != '0') {
    printf("0\n");
    return 0;
  }
  printf("%d\n", DP(0, 0));
  return 0;
}
