'''****** Задание ******** *Ошибка кассового аппарата. ''' summa = int(input()) number = int(input(), 2) print(f'{summa + number}')