#include <stdio.h>
// Function to check if a bit at a given position is set
int isBitSet(unsigned char reg, int pos) {
return (reg & (1 << pos)) ? 1 : 0;
}
int main() {
unsigned char reg;
int pos;
scanf("%hhu %d", ®, &pos);
int result = isBitSet(reg, pos);
printf("%d\n", result);
return 0;
}