Let $C$ be the number of cows, and $D$ the number of ducks. Each animal has just one head (I hope), so $C + D = 17$. On the other hand, each cow has four legs, and each duck has two legs, so $4C + 2D = 56$. Now you have two linear equations in two unknowns. Can you solve for $C,D$?