#include <stdio.h>
#include <stdlib.h>

#ifdef _MSC_VER
  #define strtoull _strtoui64
#endif

#ifdef __MINGW32__
  #define FORMAT_LLU "%I64u"
#else
  #define FORMAT_LLU "%llu"
#endif

int main(void) {
    char buf[128];

    memset(buf, 0x00, sizeof(buf));
    if ( fgets(buf, sizeof(buf), stdin) ) {
        unsigned long long ll;

        ll = strtoull(buf, NULL, 16);

        printf(FORMAT_LLU, ll);
    }
    return 0;
}
