#include <stdio.h>
#include <stdint.h>
typedef union {
uint16_t reg;
struct {
uint16_t Enable : 1; // Bit 0
uint16_t Mode : 1; // Bit 1
uint16_t Priority : 2; // Bit 2-3
uint16_t Reserved : 12;// Bit 4-15
} bits;
} ConfigRegister;
int validate_config(ConfigRegister *cfg) {
if (cfg->bits.Enable == 1 && (cfg->bits.Priority) !=3 && cfg->bits.Reserved == 0) {
return 1;
}
return 0;
}
int main() {
ConfigRegister cfg;
if (scanf("%hx", &cfg.reg) == 1) {
int result = validate_config(&cfg);
printf("%d", result);
}
return 0;
}