#include <bits/stdc++.h>
using namespace std;
struct fastIO {
  inline fastIO operator>>(int& num) {
    num = 0;
    char c = getchar();
    while (c != '-' && (c < '0' || c > '9')) c = getchar();
    bool foo = 0;
    if (c == '-') {
      foo = 1;
      c = getchar();
    }
    while (c >= '0' && c <= '9') {
      num = (num << 3) + (num << 1) + c - '0';
      c = getchar();
    }
    if (foo) num = -num;
    return *this;
  }
  inline fastIO operator>>(long long& num) {
    num = 0;
    char c = getchar();
    while (c != '-' && (c < '0' || c > '9')) c = getchar();
    bool foo = 0;
    if (c == '-') {
      foo = 1;
      c = getchar();
    }
    while (c >= '0' && c <= '9') {
      num = (num << 3) + (num << 1) + c - '0';
      c = getchar();
    }
    if (foo) num = -num;
    return *this;
  }
  inline fastIO operator>>(float& num) {
    scanf("%f", &num);
    return *this;
  }
  inline fastIO operator>>(double& num) {
    scanf("%lf", &num);
    return *this;
  }
  inline fastIO operator>>(long double& num) {
    scanf("%Lf", &num);
    return *this;
  }
  inline fastIO operator>>(char& num) {
    num = getchar();
    while (num == ' ' || num == '\n') num = getchar();
    return *this;
  }
  inline fastIO operator>>(char* num) {
    int cnt = 0;
    char c = getchar();
    while (c == ' ' || c == '\n') c = getchar();
    while (c != ' ' && c != '\n') {
      num[cnt++] = c;
      c = getchar();
    }
    num[cnt] = 0;
    return *this;
  }
  inline fastIO operator>>(string& num) {
    cin >> num;
    return *this;
  }
  inline void printInt(const int& num) {
    if (num < 10) {
      putchar(num + '0');
      return;
    }
    printInt(num / 10);
    putchar((num % 10) + '0');
  }
  inline void printINT(const long long& num) {
    if (num < 10) {
      putchar(num + '0');
      return;
    }
    printINT(num / 10);
    putchar((num % 10) + '0');
  }
  inline fastIO operator<<(const int& num) {
    if (num < 0)
      putchar('-'), printInt(-num);
    else
      printInt(num);
    return *this;
  }
  inline fastIO operator<<(const long long& num) {
    if (num < 0)
      putchar('-'), printINT(-num);
    else
      printINT(num);
    return *this;
  }
  inline fastIO operator<<(const float& num) {
    printf("%.10f", num);
    return *this;
  }
  inline fastIO operator<<(const double& num) {
    printf("%.16lf", num);
    return *this;
  }
  inline fastIO operator<<(const long double& num) {
    printf("%.20Lf", num);
    return *this;
  }
  inline fastIO operator<<(const char& num) {
    putchar(num);
    return *this;
  }
  inline fastIO operator<<(const char* num) {
    for (int i = 0; num[i]; i++) putchar(num[i]);
    return *this;
  }
  inline fastIO operator<<(const string& num) {
    cout << num;
    return *this;
  }
} fio;
char s[2005];
int dp[2005][2005];
int a[2005], x[2005], y[2005], st[2005];
int main() {
  fio >> s;
  int n = strlen(s);
  for (int i = 0; i < n - 1; i++) {
    if (!isdigit(s[i]) && (s[i + 1] == '*' || s[i + 1] == '/')) {
      return printf("0\n"), 0;
    }
  }
  if (s[0] == '*' || s[0] == '/') {
    return printf("0\n"), 0;
  }
  if (!isdigit(s[n - 1])) {
    return printf("0\n"), 0;
  }
  int m = 0, t = 0;
  for (int i = 0; i < n; i++) {
    if (!isdigit(s[i])) {
      t++;
    } else if (t || !i) {
      a[m] = t - 1;
      m++;
      t = 0;
    }
  }
  a[0]++;
  n = 0;
  for (int i = 0; i < m; i++) {
    st[i] = n;
    for (int j = a[i]; j >= 0; j--) {
      x[n] = i;
      y[n] = j;
      n++;
    }
  }
  long long tmp;
  for (int i = n - 1; i >= 0; i--) {
    dp[i][x[i]] = 1;
    for (int j = x[i] + 1; j < m; j++) {
      if (y[i] > 0) {
        dp[i][j] = dp[i + 1][j];
      } else {
        dp[i][j] = 0;
      }
      tmp = 0;
      for (int k = x[i]; k < j; k++) {
        tmp += 1LL * dp[i][k] * dp[st[k + 1]][j];
      }
      dp[i][j] = (dp[i][j] + tmp) % 1000003;
    }
  }
  fio << dp[0][m - 1] << '\n';
  return 0;
}
