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