i = [int(i) for i in input().split()] print(max(sum(i), i[2]*3))