A man goes to the farmer's market and buys some chickens and ducks. He buys a total of 20 animals. He gets a $2 discount for every chicken he buys and a $0.50 discount for every duck he buys. His total discount for all the animals totals $22.

How many chickens and how many ducks did he buy?