#include <bits/stdc++.h>
char str[4005] = {0};
long T[4005] = {0};
long f[4005][4005] = {0};
long s[4005][4005] = {0};
int main() {
  long i, j, k;
  long tot = 1;
  long sum = 0;
  scanf("%s", str + 1);
  for (i = 1; str[i]; i++) {
    if ((str[i] == '*' || str[i] == '/') &&
        (str[i - 1] > '9' || str[i - 1] < '0')) {
      printf("0\n");
      return 0;
    }
    if (str[i] > '9' || str[i] < '0')
      T[tot]++;
    else if (str[i - 1] > '9' || str[i - 1] < '0')
      sum += T[tot++];
  }
  if (str[i - 1] > '9' || str[i - 1] < '0') {
    printf("0\n");
    return 0;
  }
  tot--;
  f[0][0] = 1;
  s[0][0] = 1;
  for (i = 1; i <= tot; i++) {
    for (j = sum; j >= 0; j--) {
      f[i][j] =
          (f[i][j] + s[i - 1][((j - T[i]) > (0) ? (j - T[i]) : (0))]) % 1000003;
      s[i][j] = (s[i][j + 1] + f[i][j]) % 1000003;
    }
  }
  printf("%ld\n", f[tot][0]);
  return 0;
}
