require 'set' n=STDIN.gets.to_i as=STDIN.gets.split(" ") as.size.times do |i| as[i]=as[i].to_i end c=Set.new(as) if c.size==2 then c1=c.min e1=0 e2=0 as.each do |e| if e==c1 then e2+=1 else e1+=1 end end print e1," ",e2 puts else c1=c.min if (c1+2)/2==n then print n," 0" else print "0 ",n end puts end