#include <stdio.h>
#include <stdint.h>
int powe(int x){
int res=1;
while (x>0){
res*=2;
x--;
}
return res;
}
uint8_t set_range(uint8_t reg, uint8_t start, uint8_t end) {
return reg | ((powe(end-start+1)-1)<<start) ;
}
int main() {
uint8_t reg, start, end;
scanf("%hhu %hhu %hhu", ®, &start, &end);
printf("%u", set_range(reg, start, end));
return 0;
}