#include <bits/stdc++.h>
using namespace std;
const int mod = 1000003;
int dp[2007][2007];
int a[2007], x[2007], y[2007], st[2007];
string s;
int n, m;
int main() {
  cin >> s;
  n = ((int)(s).size());
  for (int i = 0; i < n - 1; i++)
    if (!isdigit(s[i]) && (s[i + 1] == '*' || s[i + 1] == '/')) {
      cout << 0 << endl;
      return getchar(), getchar(), 0;
      ;
    }
  if (s[0] == '*' || s[0] == '/') {
    cout << 0 << endl;
    return getchar(), getchar(), 0;
    ;
  }
  int t = 0;
  for (int i = 0; i < n; i++) {
    if (!isdigit(s[i]))
      t++;
    else if (t || i == 0) {
      a[m++] = t - 1;
      t = 0;
    }
  }
  a[0]++;
  if (t) {
    cout << 0 << endl;
    return getchar(), getchar(), 0;
    ;
  }
  n = 0;
  for (int i = 0; i < m; i++) {
    st[i] = n;
    for (int j = a[i]; j >= 0; j--) {
      x[n] = i;
      y[n] = j;
      n++;
    }
  }
  long long sum;
  for (int i = n - 1; i >= 0; i--) {
    dp[i][x[i]] = 1;
    for (int j = x[i] + 1; j < m; j++) {
      if (y[i])
        dp[i][j] = dp[i + 1][j];
      else
        dp[i][j] = 0;
      sum = 0;
      for (int k = x[i]; k < j; k++)
        sum += (long long)dp[i][k] * dp[st[k + 1]][j];
      dp[i][j] = (dp[i][j] + sum) % mod;
    }
  }
  cout << dp[0][m - 1] << endl;
  return getchar(), getchar(), 0;
  ;
}
