#include <stdio.h>
#include <stdint.h>
#define CHECK_BIT(reg, pos) ((reg) & (1 << pos))
#define SET_BIT(reg, pos) ((reg) |= (1 << pos))
uint32_t extract_field(uint32_t reg, uint8_t pos, uint8_t len) {
// Your code here
uint32_t ans = 0;
int x = 0;
for (int i = pos; i < pos + len; i++) {
if (CHECK_BIT(reg, i)){
SET_BIT(ans, x);
}
x++;
}
return ans;
}
int main() {
uint32_t reg;
uint8_t pos, len;
scanf("%u %hhu %hhu", ®, &pos, &len);
printf("%u", extract_field(reg, pos, len));
return 0;
}