The chickens had 7*2=<<7*2=14>>14 legs.
The sheep had 5*4=<<5*4=20>>20 legs.
There were 14+20=<<14+20=34>>34 legs.
#### 34