#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
const int MOD = 1000003;
int f[maxn];
string st;
int n, m, ret;
void init() { cin >> st; }
inline bool isdit(char ch) { return ch >= '0' && ch <= '9'; }
inline void Add(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
void work() {
  n = st.length();
  m = 0;
  ret = 0;
  f[0] = 1;
  for (int i = 0; i < n; i++)
    if (!isdit(st[i])) {
      if ((st[i] == '*' || st[i] == '/') && (!i || !isdit(st[i - 1]))) return;
      for (int j = m; j >= 0; j--) f[j + 1] = f[j];
      m++;
      f[0] = 0;
    } else if (i && !isdit(st[i - 1])) {
      for (int j = m; j; j--) Add(f[j - 1], f[j]);
    }
  ret = f[0];
}
void print() { cout << ret << endl; }
int main() {
  init();
  work();
  print();
  return 0;
}
