#include <bits/stdc++.h>
using namespace std;
const int mod = 1e6 + 3;
char s[2005];
int n;
int c[2005];
int r;
int st[2005];
int x[2005], y[2005];
int dp[2005][2005];
int main() {
  scanf("%s", s);
  n = strlen(s);
  if (s[0] == '*' || s[0] == '/') {
    puts("0");
    return 0;
  }
  for (int i = 0; i < n - 1; ++i) {
    if (!isdigit(s[i]) && (s[i + 1] == '*' || s[i + 1] == '/')) {
      puts("0");
      return 0;
    }
  }
  int m = 0, cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (!isdigit(s[i])) {
      cnt++;
    } else if (cnt || i == 0) {
      c[m++] = cnt - 1;
      cnt = 0;
    }
  }
  c[0]++;
  if (cnt > 0) {
    puts("0");
    return 0;
  }
  r = 0;
  for (int i = 0; i < m; ++i) {
    st[i] = r;
    for (int j = c[i]; j >= 0; --j) {
      x[r] = i, y[r++] = j;
    }
  }
  for (int i = r - 1; i >= 0; --i) {
    dp[i][x[i]] = 1;
    for (int j = x[i] + 1; j < m; ++j) {
      if (y[i] > 0) {
        dp[i][j] = dp[i + 1][j];
      } else {
        dp[i][j] = 0;
      }
      long long trans = 0ll;
      for (int k = x[i]; k < j; ++k) {
        trans += dp[i][k] * 1ll * dp[st[k + 1]][j];
      }
      dp[i][j] = (dp[i][j] + trans) % mod;
    }
  }
  printf("%d\n", dp[0][m - 1]);
  return 0;
}
