Ali has 10 hamsters and chickens.
He counted a total of 34 legs.
How many hamsters did he have?