import sys input = sys.stdin.readline A,B,O,W=map(int,input().split()) print(max(A,B)+O+W)