#include <stdio.h>

int main() 
{
    int a=0;
    int b=0;
    scanf("%x %o",&a,&b);//占位符之间的空格
    printf("%d",a+b);
    return 0;
}