#include <stdio.h>
typedef union {
unsigned char reg;
struct {
unsigned char enable : 1;
unsigned char mode : 1;
unsigned char priority : 2;
unsigned char reserved : 4;
} bits;
} ControlRegister;
int validate_register(ControlRegister *ctrl) {
return (ctrl->bits.enable) // enable must be 1
&&(ctrl->bits.priority<=2) // pririty less than or equal 2
&&(ctrl->bits.reserved==0); // reserved must be 0
}
int main() {
ControlRegister ctrl;
scanf("%hhx", &ctrl.reg);
int result = validate_register(&ctrl);
printf("%d", result);
return 0;
}