#include <bits/stdc++.h>
using namespace std;
int f[2005][2005];
char st[2005];
int n;
int dp() {
  int i, j;
  f[0][0] = 1;
  for (i = 1; i <= n; ++i)
    if (isdigit(st[i]))
      if ((st[i - 1] == '+' || st[i - 1] == '-' || st[i - 1] == '*' ||
           st[i - 1] == '/'))
        for (j = n; j >= 0; --j) {
          f[i][j] = f[i - 1][j] + f[i][j + 1];
          f[i][j] %= 1000003;
        }
      else
        memcpy(f[i], f[i - 1], sizeof(f[i]));
    else {
      if (!isdigit(st[i - 1]) && (st[i] == '*' || st[i] == '/')) return 0;
      f[i][0] = 0;
      for (j = n; j >= 0; --j) f[i][j + 1] = f[i - 1][j];
    }
  return f[n][0] % 1000003;
}
int main() {
  scanf("%st", st + 1);
  n = strlen(st + 1);
  printf("%d\n", dp() % 1000003);
  return 0;
}
