n = int(raw_input()) print sum((lambda s : any(s.count(x) > 0 for x in ["ch", "he", "ef", "che", "hef", "chef"]))(raw_input()) for __ in xrange(n))