#include <bits/stdc++.h>
using namespace std;
int ans[2005];
long long jc[4005], ny[4005], fjc[4005];
int t[2005], tc;
int st[2005], stc;
long long dp[2005][2005];
char s[2005];
int n;
inline int solve() {
  tc = 0;
  bool isn = 0, ist;
  for (int i = 0; i < n; i++) {
    ist = 0;
    if (isdigit(s[i])) {
      isn = 1;
    } else {
      if (isn) {
        t[tc++] = 0;
        isn = 0;
      }
      if (!i || !isdigit(s[i - 1])) {
        if (s[i] == '*' || s[i] == '/') {
          return 0;
        }
        t[tc++] = 1;
      } else {
        ist = 1;
      }
    }
  }
  if (isn) {
    t[tc++] = 0;
  }
  if (t[tc - 1] || ist) {
    return 0;
  }
  stc = 0;
  for (int i = 0; i < tc; i++) {
    if (t[i] == 0) {
      st[stc]++;
    } else {
      stc++;
    }
  }
  if (!stc) {
    return ans[tc];
  }
  dp[stc + 1][0] = 1;
  int sss = 0;
  for (int i = stc; i >= 0; i--) {
    int fff = st[i];
    if (i) {
      sss += fff;
      for (int j = 1; j <= sss; j++) {
        for (int k = max(fff - j, 0); k <= sss - j; k++) {
          dp[i][k + 1] += dp[i + 1][k + j - fff] * ans[j] % 1000003;
          if (dp[i][k + 1] >= 1000003) {
            dp[i][k + 1] -= 1000003;
          }
        }
      }
    } else {
      for (int j = 0; j <= sss; j++) {
        dp[i][j + fff] = dp[i + 1][j];
      }
    }
  }
  int Ans = 0;
  for (int i = 1; i <= tc; i++) {
    Ans = (Ans + dp[0][i] * ans[i]) % 1000003;
  }
  return Ans;
}
int ksmii(int a, int b) {
  if (!b) {
    return 1;
  }
  int fff = ksmii(a, b / 2);
  fff = 1LL * fff * fff % 1000003;
  if (b % 2) {
    fff = 1LL * fff * a % 1000003;
  }
  return fff;
}
int main() {
  for (int i = 1; i < 4005; i++) {
    ny[i] = ksmii(i, 1000003 - 2);
  }
  jc[0] = fjc[0] = 1;
  for (int i = 1; i < 4005; i++) {
    jc[i] = jc[i - 1] * i % 1000003;
    fjc[i] = fjc[i - 1] * ny[i] % 1000003;
  }
  ans[1] = 1;
  for (int i = 1; i <= 2000; i++) {
    ans[i + 1] = 1LL * ny[i + 1] * jc[i << 1] % 1000003 * fjc[i] % 1000003 *
                 fjc[i] % 1000003;
  }
  scanf("%s", s);
  n = strlen(s);
  printf("%d\n", solve());
  return 0;
}
