#include <bits/stdc++.h>
using namespace std;
const int mod = 1e6 + 3;
const int N = 2e3 + 23;
string str;
int n, type[N];
int dp[N][N];
inline int getType(char ch) {
  if ('0' <= ch && ch <= '9') return 1;
  if (ch == '+' || ch == '-') return 2;
  return 3;
}
bool input() {
  cin >> str;
  n = 0;
  for (auto ch : str) {
    if (n == 0) {
      if (getType(ch) == 3) return false;
      type[n] = getType(ch);
      ++n;
    } else {
      if (getType(ch) == 1) {
        if (type[n - 1] == 1) continue;
        type[n] = 1;
        ++n;
      } else if (getType(ch) == 2) {
        type[n] = 2;
        ++n;
      } else if (getType(ch) == 3) {
        if (type[n - 1] != 1) return false;
        type[n] = 3;
        ++n;
      }
    }
  }
  if (type[n - 1] != 1) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(32);
  if (!input()) {
    cout << 0 << '\n';
    exit(0);
  }
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < n; i++) {
    if (type[i] == 1) dp[i][i] = 1;
  }
  long long tmp;
  for (int len = 2; len <= n; len++) {
    for (int i = 0, j = len - 1; j < n; i++, j++) {
      if (type[i] == 3 || type[j] != 1) continue;
      tmp = 0;
      for (int k = i + 1; k < j; k++) {
        if (type[k] != 1) tmp += dp[i][k - 1] * 1LL * dp[k + 1][j];
      }
      if (type[i] == 2) tmp += dp[i + 1][j];
      dp[i][j] = tmp % mod;
    }
  }
  cout << dp[0][n - 1] << '\n';
  return 0;
}
