An extremely handsome math teacher was on a farm and he counted 32 animals; all pigs and chickens. Then he counted the number of feet. The total was 88. Find the number of pigs and the number of chickens. (Hint: You need to take the number of legs each animal has into consideration.)