#include <bits/stdc++.h>
using namespace std;
const int N = 2100;
char txt[N];
string presolve(string s) {
  string res;
  int n = s.size();
  int i = 0;
  while (i < n) {
    if (s[i] == '+' || s[i] == '-') {
      res += '+';
      i++;
      continue;
    }
    if (s[i] == '*' || s[i] == '/') {
      res += '*';
      i++;
      continue;
    }
    res += 'x';
    while (i < n && isdigit(s[i])) i++;
  }
  return res;
}
const int mod = 1000003;
int dp1[N][N], dp2[N][N];
int main() {
  scanf("%s", txt);
  string s = presolve(txt);
  if (s == "x") {
    cout << 1 << endl;
    return 0;
  }
  dp1[0][0] = 1;
  int n = s.size();
  for (int i = 0; i <= n; i++) {
    for (int j = N - 1; j >= 0; j--) {
      if (dp2[i][j]) {
        dp1[i + 1][j + 1] = (dp1[i + 1][j + 1] + dp2[i][j]) % mod;
        if (j > 0) dp2[i][j - 1] = (dp2[i][j - 1] + dp2[i][j]) % mod;
      }
    }
    for (int j = 0; j < N; j++) {
      if (dp1[i][j]) {
        if (s[i] == '+')
          dp1[i + 1][j + 1] = (dp1[i + 1][j + 1] + dp1[i][j]) % mod;
        if (s[i] == 'x')
          dp1[i + 2][j + 1] = (dp1[i + 2][j + 1] + dp1[i][j]) % mod;
        if (s[i] == 'x' && j > 0)
          dp2[i + 1][j - 1] = (dp2[i + 1][j - 1] + dp1[i][j]) % mod;
      }
    }
  }
  cout << dp2[n][0] << endl;
  return 0;
}
