#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, f[2010] = {1};
string s;
int main() {
  cin >> s;
  for (i = 0; i < s.length(); i++)
    if (s[i] < '0') {
      if ((s[i] == '*' || s[i] == '/') && (!i || s[i - 1] < '0')) {
        cout << "0";
        return 0;
      }
      for (j = m++; j >= 0; j--) f[j + 1] = f[j];
      f[0] = 0;
    } else if (i && s[i - 1] < '0')
      for (j = m; j; j--) f[j - 1] = (f[j - 1] + f[j]) % 1000003;
  cout << f[0] << endl;
  return 0;
}
