#include <bits/stdc++.h>
using namespace std;
const int mod = 1000003;
int dp[2002][2002];
string parse(const string& exp) {
  string res;
  bool first = true;
  for (int i = 0; i < (((int)(exp).size())); ++i) {
    if (!isdigit(exp[i])) {
      if (first && (((exp[i]) == '*') || ((exp[i]) == '/'))) throw 1;
      res += i ? "*" : "+";
      i++;
    }
    for (; i < ((int)(exp).size()) && !isdigit(exp[i]); i++) {
      if (!(((exp[i]) == '*') || ((exp[i]) == '/')))
        res += "+";
      else
        throw 1;
    }
    if (i == ((int)(exp).size())) throw 1;
    while (i + 1 < ((int)(exp).size()) && isdigit(exp[i + 1])) ++i;
    first = false;
  }
  return res;
}
int main() {
  string exp;
  cin >> exp;
  string simple;
  try {
    simple = parse(exp);
  } catch (...) {
    cout << 0 << endl;
    return 0;
  }
  if (simple.empty()) simple = "+";
  const int n = count((simple).begin(), (simple).end(), '*') + 1;
  for (int i = 0; i < n; i++) {
    dp[0][i] = 1;
  }
  for (int a = 1; a < ((int)(simple).size()); a++) {
    for (int b = 0; b < n; b++) {
      int& res = dp[a][b];
      res = dp[a - 1][b + (simple[a - 1] == '*' ? 1 : 0)];
      if (b) res += dp[a][b - 1], res %= mod;
    }
  }
  cout << ((simple[((int)(simple).size()) - 1] == '*')
               ? dp[((int)(simple).size()) - 1][1]
               : dp[((int)(simple).size()) - 1][0])
       << endl;
  return 0;
}
