v = list(map(int, input().split())) assert len(v) == 4 print(sum(v)-min(v[0],v[1]))