#include <bits/stdc++.h>
using namespace std;
inline void EnableFileIO(const string& fileName, bool local = 0) {
  if (fileName.empty()) return;
  if (local) {
    freopen((fileName + ".in").c_str(), "r", stdin);
    freopen((fileName + ".out").c_str(), "w", stdout);
    return;
  }
  freopen((fileName + ".in").c_str(), "r", stdin);
  freopen((fileName + ".out").c_str(), "w", stdout);
}
const int INF = (1 << 30) - 1;
const long long LINF = (1LL << 61) - 1;
const double EPS = 1e-10, PI = acos(-1);
const int N = 2e3 + 100, P = 1e6 + 3;
int n, l;
string s;
vector<int> v;
long long f[N][N], sum[N];
int main() {
  cin >> s;
  l = (int)s.length();
  for (int i = 0, buff = 0; i < l; i++) {
    if (!isdigit(s[i])) {
      ++buff;
    } else {
      if (buff) v.push_back(buff), buff = 0;
    }
    if ((i == l - 1 && buff) ||
        ((!i || !isdigit(s[i - 1])) && (s[i] == '*' || s[i] == '/'))) {
      cout << 0 << endl;
      return 0;
    }
  }
  n = (int)v.size();
  f[0][0] = 1;
  for (int i = 0; i < n; i++) {
    memset(sum, 0, sizeof sum);
    for (int j = 0; j < l; j++) sum[j] = ((j ? sum[j - 1] : 0) + f[i][j]) % P;
    for (int j = 0; j < l; j++) {
      f[i + 1][j] =
          (sum[l - 1] - (j - v[i] - 1 >= 0 ? sum[j - v[i] - 1] : 0) + P) % P;
    }
  }
  cout << f[n][0] << endl;
  return 0;
}
