s=list(map(int,input().split())) s.sort() s.remove(s[0][5]) print(sum(s))