try: a,b,c=sorted(int(input()) for _ in range(int(input()))) if a==b==c: print(a+b) elif a==b: print(a+b) else: print(c+a) except: print('"assert"')