#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
char c[2005], s[2005];
bool is[2005];
long long dp1[2005][2005], dp2[2005][2005], mod = 1e6 + 3;
signed main() {
  scanf("%s", c + 1);
  int len, n = 0;
  len = strlen(c + 1);
  bool f = 0;
  for (int 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';
  for (int i = 1; i <= n; i++) is[i] = s[i] == '1';
  for (int i = n; i >= 1; i--) {
    if (s[i] == '1') dp1[i][i] = dp2[i][i] = 1;
    for (int j = i + 1; j <= n; j++)
      if (is[j]) {
        long long t = 0;
        if (s[i] == '+') t = dp1[i + 1][j];
        long long *d1 = dp1[i] - 1, *d2 = dp2[j] + 1;
        for (int k = i + 1; k <= j - 1; k++)
          if (!is[k]) t += 1ll * d1[k] * d2[k];
        t %= mod;
        dp1[i][j] = dp2[j][i] = t;
      }
  }
  cout << dp1[1][n];
  return 0;
}
