A,B,O,W=map(int,input().split()) ans=O if A>=B:ans+=A else:ans+=B ans+=W print(ans)