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