#include <bits/stdc++.h>
using namespace std;
const int maxn = 2020;
const int mod = 1000003;
int dp[maxn][maxn];
int div_to_ops[maxn], ops_to_div[maxn];
int pt[maxn];
char s[maxn];
bool end[maxn];
int main() {
  scanf("%s", s);
  if (s[0] == '/' || s[0] == '*') {
    printf("0\n");
    return 0;
  }
  int len = strlen(s);
  for (int i = (0); i < (int)(len - 1); ++i)
    if ((s[i] < '0' || s[i] > '9') && (s[i + 1] == '/' || s[i + 1] == '*')) {
      printf("0\n");
      return 0;
    }
  if (s[len - 1] < '0' || s[len - 1] > '9') {
    printf("0\n");
    return 0;
  }
  int div = 1;
  for (int i = (0); i < (int)(len); ++i) {
    if (s[i] < '0' || s[i] > '9')
      pt[div]++;
    else if (i == 0 || s[i - 1] < '0' || s[i + 1] > '9')
      div++;
  }
  int cnt_ops = 0;
  dp[0][0] = 1;
  for (int i = (0); i < (int)(div); ++i) {
    for (int j = (0); j < (int)(cnt_ops + 1); ++j) {
      if (dp[i][j]) {
        for (int k = (0); k < (int)(j + 1); ++k)
          dp[i + 1][j - k + pt[i + 1]] =
              (dp[i + 1][j - k + pt[i + 1]] + dp[i][j]) % mod;
      }
    }
    cnt_ops += pt[i + 1];
  }
  printf("%d\n", dp[div][0]);
  return 0;
}
