_,*c=$<.read.split.map &:to_i puts "#{c.count(4)} #{c.count(2)}"