#include <stdio.h>
#include <stdint.h>
uint16_t pack_register(uint8_t mode, uint8_t speed, uint8_t status) {
// Your logic here
uint16_t reg;
for (int i = 0; i < 16; i++){
if (i <= 2){
if (mode & (1<<i)){
reg |= (1<<i);
}
} else if (3 <= i && i <= 7){
if (speed & (1<<(i-3))){
reg |= (1<<i);
}
} else if (10 <= i && i <= 15){
if (status & (1<<(i-10))){
reg |= (1<<i);
}
}
}
return reg;
}
int main() {
uint8_t mode, speed, status;
scanf("%hhu %hhu %hhu", &mode, &speed, &status);
uint16_t reg = pack_register(mode, speed, status);
printf("%u", reg);
return 0;
}