#include <bits/stdc++.h>
using namespace std;
int dp[2001][2001] = {}, content[2001] = {}, content_size = 0;
;
const int mod = 1000003;
bool parse(string s) {
  int state = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (isdigit(s[i])) {
      int j = i;
      while (isdigit(s[j])) {
        ++j;
      }
      i = j - 1;
      content[content_size++] = 1;
      state = 1;
    } else if (s[i] == '+' || s[i] == '-') {
      content[content_size++] = 2;
      if (i == s.size() - 1 || s[i + 1] == '/' || s[i + 1] == '*') return false;
    } else if (s[i] == '*' || s[i] == '/') {
      content[content_size++] = 2;
      if (i == 0 || i == s.size() - 1 || s[i + 1] == '*' || s[i + 1] == '/')
        return false;
    }
  }
  return true;
}
int solve(int p, int b) {
  if (b < 0) return 0;
  if (p == content_size) return dp[p][b] = (b == 0);
  if (dp[p][b] != -1) return dp[p][b];
  if (content[p] == 1) {
    dp[p][b] = (solve(p + 1, b) + solve(p, b - 1)) % mod;
  } else if (content[p] == 2) {
    dp[p][b] = solve(p + 1, b + 1);
  }
  return dp[p][b];
}
int main() {
  string s;
  memset(dp, -1, sizeof(dp));
  cin >> s;
  if (parse(s)) {
    cout << solve(0, 0) << endl;
  } else {
    cout << 0 << endl;
  }
}
