hexa={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,"A":10, "B":11,"C":12,"D":13,"E":14,"F":15} octa={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8} num = input().split() obj = 0 a = num[0][2:] b = num[1][1:] for i in range(len(a)): obj += hexa[a[i]]*16**(len(a)-1-i) for j in range(len(b)): obj += octa[b[j]]*8**(len(b)-1-j) print(obj)
nums = input().split() num1 = int(nums[0], 16) num2 = int(nums[1], 8) print(num1+num2)
a, b = map(str,input().split(" ")) print(int(a,16)+int(b,8))