#include <stdio.h>

int main(void) {
	unsigned short x, y;
	unsigned base = 16;
	
	char *input = "f5+";
	
	x = strtol(input, NULL, base);
	x /= base;
	
	y = strtol(input, NULL, base);
	y %= base;
	
	printf("%u\n%x\n", x+y, x+y);
	return 0;
}
