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