#include<stdio.h> #include<string.h> int main() { char S[100],op='0'; gets(S); int flag=0,i,n=strlen(S),num1,num2=1,ans; for(i=0;i<n;i++) { if(S[i]=='!')flag=1; } if(flag==1) { sscanf(S,"%d %*c",&num1); for(ans=1,i=1;i<=num1;i++) { ans*=i; } } else if(flag==0) { sscanf(S,"%d %c %d",&num1,&op,&num2); switch(op) { case '+':ans=num1+num2; break; case '-':ans=num1-num2; break; case '*':ans=num1*num2; break; default:if(num2==0){ printf("error");break; } else if(op=='/')ans=num1/num2; else if(op=='%')ans=num1%num2; break; } } if(!(num2==0&&(op=='%'||op=='/')))printf("%d\n",ans); return 0; }