#include <iostream>
#include <vector>
#include <string>
using namespace std;

bool in(char num){
  return (num >= '0' && '9' >= num);
}

int main(void){
  string str;
  while(cin>>str){
    int res = 0,num=0;
    char opp = 0;
    for(int i = 0 ; i < str.size() ; i ++){
      if(in(str[i])){
	num = num * 10 + str[i] - '0';
	if(num >= 10000){
	  cout<<'E';
	  break;
	}
      }else{
	if(opp == 0){
	  res = num;
	}else if(opp == '+'){
	  res += num;
	}else if(opp == '-'){
	  res -= num;
	}else if(opp == '*'){
	  res *= num;
	}
	num = 0;
	if(res<0 || 10000<=res){
	  cout<<'E'<<endl;
	}
	opp = str[i];
	  
      }	
      if(opp=='='){
	cout<<res;
	break;					
      } 
    }
    cout<<endl;   
  }
}