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