a,b,o,ab=map(int,input().split()) print(o+max(a,b)+ab)