#include <stdio.h>

int jiecheng(int n) {
	if(n==0||n==1) return 1;
	else return n*jiecheng(n-1);
}

int main() {
	int a,c;
	char b;
	while (scanf("%d",&a) != EOF) {
		scanf(" %c",&b);
		if(b=='!') {
			printf("%d\n",jiecheng(a));
		} else if(b=='+') {
			scanf(" %d",&c);
			printf("%d\n",a+c);
		} else if(b=='-') {
			scanf(" %d",&c);
			printf("%d\n",a-c);
		} else if(b=='*') {
			scanf(" %d",&c);
			printf("%d\n",a*c);
		} else if(b=='/') {
			scanf(" %d",&c);
			if(c==0) {
				printf("error\n");
			} else {
				printf("%d",a/c);
			}
		} else if(b=='%') {
			scanf(" %d",&c);
			if(c==0) {
				printf("error\n");
			} else {
				printf("%d\n",a%c);
			}
		}
	}
	return 0;
}