class Yukicoder def initialize r, g, b = gets.chomp.split(' ').map(&:to_i) list = [r,g,b].sort sum = 0 loop do a, b, c = list count = [b - a, (2+c-b)/2].min list[0] += count list[2] -= 2 * count create = list.min break if create.zero? sum += create list = list.map{|i| i - create}.sort end puts sum end end Yukicoder.new