#include <stdio.h>
#include <stdint.h>
// Define macros here
uint16_t build_register(uint8_t enable, uint8_t mode, uint8_t speed) {
uint16_t ans=0;
if(enable) ans=(1<<0);
uint16_t tg=(mode&(1<<0b11)-1)<<1; // có bit từ 1-2 trên thanh 16 thì là 2 bit tính từ 0 max có thể là 3
ans|=tg;
tg=0; tg=(speed&(1<<0b111)-1)<<3; // có bit từ 3-5 trên thanh 16 thì là 3 bit tính từ 0 max có thể là 7
ans|=tg;
return ans;
}
int main() {
uint8_t enable, mode, speed;
scanf("%hhu %hhu %hhu", &enable, &mode, &speed);
uint16_t reg = build_register(enable, mode, speed);
printf("%u", reg);
return 0;
}