#include <bits/stdc++.h>
using namespace std;
const long long M = 1e6 + 3;
long long n, f[2005][2005];
long long m, len[2005], st[2005], x[2005], y[2005];
char ch[2005];
signed main() {
  scanf("%s", ch + 1);
  n = strlen(ch + 1);
  for (long long i = 1; i < n; i++)
    if ((ch[i] < '0' || ch[i] > '9') && (ch[i + 1] == '*' || ch[i + 1] == '/'))
      return puts("0"), 0;
  if (ch[1] == '*' || ch[1] == '/') return puts("0"), 0;
  long long t = 0;
  for (long long i = 1; i <= n; i++)
    if (ch[i] < '0' || ch[i] > '9')
      t++;
    else if (t || i == 1) {
      len[++m] = t - 1;
      t = 0;
    }
  len[1]++;
  if (t) return puts("0"), 0;
  n = 0;
  for (long long i = 1; i <= m; i++) {
    st[i] = n + 1;
    for (long long j = len[i]; j >= 0; j--) x[++n] = i, y[n] = j;
  }
  for (long long l = n; l >= 1; l--) {
    f[l][x[l]] = 1;
    for (long long r = x[l] + 1; r <= m; r++) {
      f[l][r] = y[l] > 0 ? f[l + 1][r] : 0;
      long long num = 0;
      for (long long k = x[l]; k < r; k++) num += f[l][k] * f[st[k + 1]][r];
      f[l][r] = (f[l][r] + num) % M;
    }
  }
  cout << f[1][m] << endl;
  return 0;
}
