#include <stdio.h>

int main()
{
    int a, b;
    scanf("%x %o", &a, &b);//16进制 x大小写无所谓 改为o 为8进制
    
    printf("%d", a+b);
    
    return 0;
}