a,b,c,d,e=map(int,input().split()) print(min(a+c,b+d,c+e,d+a,e+b,(a+b+c+d+e)//3))