#include int main() { int n,suma=0,br,k=1; scanf("%x",&n); while (n > 0) { suma+=(n%16)*k; k*=16; n/=16; } printf("%d\n",suma); return 0; }