#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000003, dp[2005][2005];
string str;
void finish() {
  cout << "0" << endl;
  exit(0);
}
long long int recur(long long int pos, long long int rem) {
  if (rem < 0 || 2005 <= rem) return 0;
  long long int &res = dp[pos][rem];
  if (res != -1) return res;
  if (((long long int)(str).size()) == pos) return res = ((rem == 0) ? 1 : 0);
  if (str[pos] == '?') return res = (recur(pos + 1, rem));
  if (isdigit(str[pos])) {
    return res = (recur(pos + 1, rem) + recur(pos + 1, rem - 1)) % mod;
  }
  if (rem == 0) return res = recur(pos + 1, rem + 1);
  return res = (recur(pos + 1, rem) + recur(pos + 1, rem + 1)) % mod;
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> str;
  for (long long int i = 0;
       i < ((long long int)(((long long int)(str).size()))); ++i)
    if (str[i] == '*' && (i == 0 || !isdigit(str[i - 1]))) finish();
  for (long long int i = 0;
       i < ((long long int)(((long long int)(str).size()))); ++i)
    if (str[i] == '/' && (i == 0 || !isdigit(str[i - 1]))) finish();
  for (long long int i = 0;
       i < ((long long int)(((long long int)(str).size()))); ++i)
    if (i && isdigit(str[i - 1]) && isdigit(str[i])) str[i - 1] = '?';
  cout << recur(0, 0) << endl;
}
