#include <stdio.h>
#include <stdint.h>
uint8_t compress_bits(uint16_t val) {
// Your logic here
uint8_t result = 0;
for (int i = 0; i < 8; i++)
{
// Extract bit at position multiple of 2 from val starting from 0
uint8_t bit = (val >> (2 * i)) & 1;
// Place it at i-th bit position in result
result |= (bit << i);
}
return result;
}
int main() {
uint16_t val;
scanf("%hu", &val);
uint8_t result = compress_bits(val);
printf("%u", result);
return 0;
}