#include <bits/stdc++.h>
using namespace std;
const int mo = 1e6 + 3;
char S[2003];
int n, AN[2003], cnt, K[2003], an, now, df, a, b;
int Son[2003][2], Cnt[2003];
int main() {
  scanf("%s", S + 1);
  n = strlen(S + 1);
  K['+'] = K['-'] = K['*'] = K['/'] = 1;
  S[0] = '+';
  for (int i = 1; i <= n; ++i)
    if (K[(int)S[i - 1]] && (S[i] == '*' || S[i] == '/')) an = -1;
  if (K[(int)S[n]] || an == -1) return puts("0"), 0;
  now = n;
  cnt = an = Cnt[1] = 1;
  while (now > 0) {
    while (!K[(int)S[now]]) --now;
    if (!now) break;
    if (K[(int)S[now - 1]]) {
      a = an, b = cnt;
      an = 0;
      for (int i = cnt; i; --i) {
        an += Cnt[i];
        (an >= mo ? an -= mo : an);
      }
      for (int i = cnt; i; --i) {
        Cnt[i] += Cnt[i + 1];
        (Cnt[i] >= mo ? Cnt[i] -= mo : Cnt[i]);
      }
    } else {
      an = 0;
      for (int i = cnt; i; --i) {
        Cnt[i + 1] = Cnt[i];
        an += Cnt[i];
        (an >= mo ? an -= mo : an);
      }
      Cnt[1] = 0;
      ++cnt;
      Cnt[cnt + 1] = 0;
      for (int i = cnt; i; --i) {
        Cnt[i] += Cnt[i + 1];
        (Cnt[i] >= mo ? Cnt[i] -= mo : Cnt[i]);
      }
    }
    --now;
  }
  printf("%d\n", an);
  return 0;
}
