#include <bits/stdc++.h>
using namespace std;
int f[8000];
char s[8000];
int main() {
  scanf("%s", s);
  int n = strlen(s), m = n;
  if (s[0] == '*' || s[0] == '/') {
    puts("0");
    return 0;
  }
  f[m] = 1;
  for (int i = 0; i < n; i++)
    if (!isdigit(s[i]))
      if (s[i + 1] == '*' || s[i + 1] == '/' || i == n - 1) {
        puts("0");
        return 0;
      } else
        m--;
    else if (!isdigit(s[i + 1]))
      for (int j = m + n; j > m; j--) f[j - 1] = (f[j - 1] + f[j]) % 1000003;
  printf("%d\n", f[m]);
  return 0;
}
