l = list(map(int,input().split())) print(max(max(l[:3])*3,sum(l)))