#include <bits/stdc++.h>
using namespace std;
char str[4010];
int Dp() {
  static int F[4010];
  int n, m;
  n = m = strlen(str + 1);
  F[n] = 1;
  for (int i = 1; i <= n; i++) {
    if (str[i] < '0') {
      if (str[i] == '+' || str[i] == '-' || (i && str[i - 1] >= '0'))
        m--;
      else
        return 0;
    } else if (str[i + 1] < '0')
      for (int j = m + n; j >= m; j--) F[j] = (F[j] + F[j + 1]) % 1000003;
  }
  return F[m];
}
int main() {
  scanf("%s", str + 1);
  printf("%d\n", Dp());
  return 0;
}
