#include <stdio.h>
#include <stdint.h>
uint8_t extract_field(uint16_t reg)
{
return (uint8_t)((reg>>4)&(0x1F)); //reg>>4: this will help to get 4bits onto position:0.
//Then we can directly perform AND with 0x1F,to get data from the repsective 5 bits.
}
int main() {
uint16_t reg;
scanf("%hx", ®);
printf("%u", extract_field(reg));
return 0;
}