line = gets.chomp.split.map(&:to_i) puts [line.min,((line.sum)/4).ceil,((line.sum)/4).floor].min