#include <stdio.h>
#include <stdint.h>
typedef struct {
unsigned short reg;
} ConfigRegister;
// typedef union {
// struct{
// uint8_t EnableBit;
// uint8_t ModeBit;
// unint8_t PriorityBit
// }
// } ConfigRegister;
int validate_config(ConfigRegister *cfg) {
// Write logic using pointer access
if((cfg->reg & (1U)) != 1){
return 0;
}
if(((cfg->reg) >> 3) & ((1U<<4) - 1) == 3){
return 0;
}
if(((cfg->reg) >> 4) & (0xFF) != 0){
return 0;
}
return 1;
}
int main() {
ConfigRegister cfg;
scanf("%hx", &cfg.reg);
int result = validate_config(&cfg);
printf("%d", result);
return 0;
}