#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int f(char* str);

int main() {


    char word[20];
    scanf("%s", word);
    printf("%d\n", f(word));
    return 0;
}

int f(char* str) {

    int len = strlen(str);

    int res = 0;
    for (int i=0; i<len; i+=4) {

        for (int j=0; j<4; j++)
            if (i+j<len)
                res = res ^ (str[i+j]<<(24-8*j));
    }

    return res;
}
