Animals on the farm

My friend who owns a farm near Bangalore has five droves of animals on his farm consisting of cows, sheep and pigs with the same number of animals in each drove. One day he decided to sell them all and sold them to eight dealers. Each of the eight dealers bought the same number of animals and paid at the rate of $17 for each cow, $2 for each sheep and $2 for each pig. My friend received from the dealers in total $301. How many animals in all did he have and how many of each kind?