#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000003;
const int MAXN = 2020;
char str[MAXN];
bool tag[MAXN];
int dp[MAXN * 2][MAXN][2];
int main() {
  scanf("%s", str + 1);
  int N = strlen(str + 1);
  int cnt = 0;
  bool sol = true;
  for (int i = 1; i <= N; i++) {
    cnt += !isdigit(str[i]);
    if (!isdigit(str[i - 1]) && !isdigit(str[i])) {
      tag[cnt] = true;
      if (str[i] == '*' || str[i] == '/') sol = false;
    }
  }
  if (!isdigit(str[N])) sol = false;
  if (!sol) {
    puts("0");
    return 0;
  }
  dp[0][0][0] = 1;
  for (int i = 1; i <= (cnt << 1); i++) {
    for (int j = 0; j <= min(i, cnt); j++) {
      int cur_rig = (i - j) >> 1;
      if (tag[cur_rig]) {
        dp[i][j][0] = dp[i - 1][j + 1][1];
      } else
        dp[i][j][0] = (dp[i - 1][j + 1][1] + dp[i - 1][j + 1][0]) % MOD;
      dp[i][j][1] = (dp[i - 1][j - 1][1] + dp[i - 1][j - 1][0]) % MOD;
    }
  }
  printf("%d\n", dp[cnt << 1][0][0]);
}
