r,a,b = gets.split().map(&:to_i).sort a -= r b -=r if a*3 <= b r += a b -+ a*3 r += b/5 else s = (b-a)/2 r += s a -= s b -= s*3 a -= 1 if (a+b)%8 == 4 r += (a+b)/4 end puts r