#include <bits/stdc++.h>
const int mod = 1000003;
char str[2010];
int f[2010][2010];
int main() {
  int n, i, j, len;
  bool flag = true;
  gets(str);
  n = strlen(str);
  for (i = 0; i <= n; i++) {
    if (str[i] == '*' || str[i] == '/' || i == n)
      if (i == 0 || str[i - 1] < '0' || str[i - 1] > '9') flag = false;
  }
  if (!flag) {
    printf("0\n");
    return 0;
  }
  f[0][0] = 1;
  len = 0;
  for (i = 1; i <= n; i++) {
    flag = ('0' <= str[i - 1] && str[i - 1] <= '9');
    if (!flag) len++;
    for (j = len; j >= 0; j--) {
      if (flag) {
        f[i][j] = f[i - 1][j];
        if ('0' > str[i] || str[i] > '9')
          f[i][j] = (f[i][j] + f[i][j + 1]) % mod;
      } else if (j > 0)
        f[i][j] = f[i - 1][j - 1];
    }
  }
  printf("%d\n", f[n][0]);
  return 0;
}
