#include <bits/stdc++.h>
using namespace std;
namespace FGF {
int n, m;
const int N = 2005, mo = 1e6 + 3;
char s[N];
int pos[N], f[N][N], g[N][N];
void work() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  if (s[1] == '/' || s[1] == '*' || !isdigit(s[n])) {
    puts("0");
    return;
  }
  for (int i = 1; i <= n; i++)
    if (!isdigit(s[i])) {
      if (s[i + 1] == '/' || s[i + 1] == '*') {
        puts("0");
        return;
      }
      if (s[i + 1] == '+' || s[i + 1] == '-') pos[m] = 1;
      ++m;
    }
  f[0][0] = 1;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j <= m; j++)
      g[i][j] = ((j ? g[i][j - 1] : 0) + f[i][j]) % mo;
    if (!pos[i])
      for (int j = 0; j < m; j++)
        f[i + 1][j] = (f[i + 1][j] + g[i][j + 1]) % mo;
    else
      for (int j = 1; j < m; j++) f[i + 1][j] = (f[i + 1][j] + g[i][j]) % mo;
  }
  printf("%d\n", f[m][0]);
}
}  // namespace FGF
int main() {
  FGF::work();
  return 0;
}
