After trying again and again, finally Ted resorted to actually counting heads by placing his hand on their heads.