In a crowd of horses and people, you count 52 legs and 18 heads. How many horses are in the crowd? Explain your reasoning.