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