n = gets.to_i sum = gets.split.map(&:to_i) other = n - 1 minimum = sum.min maximum = sum.max count_t = 0 count_k = 0 if minimum == maximum if sum[0] / other == 2 count_t += n elsif sum[0] / other == 4 count_k += n end else count_t += sum.count(maximum) count_k += sum.count(minimum) end a = [] a.push(count_t, count_k) puts a.join(" ")