while 1:print reduce(lambda r,c:r+max(r+c),raw_input())