#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
char c[2005], s[2005];
long long dp1[2005][2005], dp2[2005][2005], mod = 1e6 + 3;
signed main() {
  scanf("%s", c + 1);
  long long len, n = 0;
  len = strlen(c + 1);
  bool f = 0;
  for (long long i = 1; i <= len; i++) {
    if (!isdigit(c[i])) {
      if (f) {
        s[++n] = '1';
      }
      if (c[i] == '/' || c[i] == '*') {
        s[++n] = '*';
      } else
        s[++n] = '+';
      f = 0;
    } else
      f = 1;
  }
  if (f) s[++n] = '1';
  if (n == 1 && s[1] == '1') {
    cout << 1;
    return 0;
  }
  dp1[0][0] = 1;
  for (long long i = 0; i <= n; i++) {
    for (long long j = n; j >= 0; j--) {
      dp1[i + 1][j + 1] = (dp1[i + 1][j + 1] + dp2[i][j]) % mod;
      if (j) {
        dp2[i][j - 1] = (dp2[i][j - 1] + dp2[i][j]) % mod;
      }
    }
    if (i == n) break;
    for (long long j = 0; j <= n; j++) {
      if (s[i + 1] == '+') {
        dp1[i + 1][j + 1] = (dp1[i + 1][j + 1] + dp1[i][j]) % mod;
      } else if (s[i + 1] == '1') {
        dp1[i + 2][j + 1] = (dp1[i + 2][j + 1] + dp1[i][j]) % mod;
        if (j) dp2[i + 1][j - 1] = (dp2[i + 1][j - 1] + dp1[i][j]) % mod;
      }
    }
  }
  cout << dp2[n][0];
  return 0;
}
