A = list(map(int, input().split())) ans = max(A[2]*3, sum(A)) print(ans)