#include <stdio.h>

int main() {
	int input;
	scanf("%d",&input);
	
	if(input >= 100 && input <= 999) {
		int output = 0;
		int num = 100;
		while(input > 0) {
			int digit = input % 10;
			output = output + num * digit;
			num /= 10;
			input /= 10;
		}
		printf("%d",output);
	} else {
		printf("-1");
	}
	
	return 0;
}