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