#include <bits/stdc++.h>
using namespace std;
const int modulo = 1000003;
int f[2001][2001];
char expr[2001];
int main() {
  scanf("%s", expr);
  int n = strlen(expr);
  memset(f, 0, sizeof(f));
  f[0][0] = 1;
  int ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= n; j++)
      if (f[i][j] > 0) {
        if (j < n) f[i][j + 1] = (f[i][j + 1] + f[i][j]) % modulo;
        if ('0' <= expr[i] && expr[i] <= '9') {
          int k = i;
          while (k < n && '0' <= expr[k] && expr[k] <= '9') k++;
          if (k < n) {
            if (j > 0) f[k + 1][j - 1] = (f[k + 1][j - 1] + f[i][j]) % modulo;
          } else {
            if (j == 0) ans = (ans + f[i][j]) % modulo;
          }
        }
        if (expr[i] == '+' || expr[i] == '-') {
          f[i + 1][j] = (f[i + 1][j] + f[i][j]) % modulo;
        }
      }
  printf("%d\n", ans);
  return 0;
}
