The Rally family has 3 types of pets: cats, dogs, and horses. Their total number of pets is 12. The ratio of cats to dogs to horses is 3:1:2. How many of their pets are horses?