#include <bits/stdc++.h>
const int mod = 1000003;
int f[2010][2010], a[2010], bel[2010], num[2010], st[2010], m, t, k;
char s[2010];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  for (int i = 0; i < n - 1; i++)
    if (s[i] < '0' || s[i] > '9')
      if (s[i + 1] == '*' || s[i + 1] == '/') return puts("0"), 0;
  if (s[0] == '*' || s[0] == '/') return puts("0"), 0;
  for (int i = 0; i < n; i++)
    if (s[i] < '0' || s[i] > '9')
      ++t;
    else if (t || i == 0)
      a[m++] = t - 1, t = 0;
  if (t != 0) return puts("0"), 0;
  ++a[0];
  for (int i = 0, j; i < m; i++)
    for (st[i] = k, j = a[i]; ~j; j--) bel[k] = i, num[k] = j, ++k;
  for (int i = k - 1; ~i; i--) {
    f[i][bel[i]] = 1;
    for (int j = bel[i] + 1; j < m; j++) {
      if (num[i] > 0)
        f[i][j] = f[i + 1][j];
      else
        f[i][j] = 0;
      for (int p = bel[i]; p < j; p++)
        f[i][j] = (f[i][j] + 1ll * f[i][p] * f[st[p + 1]][j]) % mod;
    }
  }
  printf("%d\n", f[0][m - 1]);
  return 0;
}
