#include <bits/stdc++.h>
using namespace std;
int dp[2001][2001];
int gao(char* s) {
  int n = strlen(s), m = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '+' || s[i] == '-') s[i] = '+';
    if (s[i] == '*' || s[i] == '/') s[i] = '*';
    if (s[i] >= '0' && s[i] <= '9') s[i] = '0';
  }
  if (s[0] == '*' || s[n - 1] != '0') return 0;
  for (int i = 1; i < n; i++)
    if (s[i - 1] != '0' && s[i] == '*') return 0;
  for (int i = dp[0][0] = 1; i <= n; i++) {
    if (s[i - 1] != '0') m++;
    for (int j = m; ~j; j--)
      if (s[i - 1] == '0') {
        dp[i][j] = dp[i - 1][j];
        if (s[i] != '0') dp[i][j] = (dp[i][j] + dp[i][j + 1]) % 1000003;
      } else if (j)
        dp[i][j] = dp[i - 1][j - 1];
  }
  return dp[n][0];
}
int main() {
  char s[2005] = {};
  printf("%d\n", gao(gets(s)));
}
