no of farmers = 8

no of farms each farmer had = 8 therefore, total no of farms = 8 x 8 = 64

no of dogs each farm had = 8 therefore, total no of dogs = 64 x 8 = 512

no of puppies each dog had = 8 therefore, total no of puppies = 512 x 8 = 4096

no of fleas each puppy had = 8 therefore, total no of fleas = 4096 x 8 = 32,768

total no of legs of 512 dogs = 512 x 4 = 2048 total no of legs of 4096 puppies = 4096 x 4 = 16384 total no of legs of 32768 fleas = 32768 x 6 = 131072

Hence, total number of legs present = 2048 + 16384 + 131072 = 149,504 legs

no of farms each farmer had = 8 therefore, total no of farms = 8 x 8 = 64

no of dogs each farm had = 8 therefore, total no of dogs = 64 x 8 = 512

no of puppies each dog had = 8 therefore, total no of puppies = 512 x 8 = 4096

no of fleas each puppy had = 8 therefore, total no of fleas = 4096 x 8 = 32,768

total no of legs of 512 dogs = 512 x 4 = 2048 total no of legs of 4096 puppies = 4096 x 4 = 16384 total no of legs of 32768 fleas = 32768 x 6 = 131072

Hence, total number of legs present = 2048 + 16384 + 131072 = 149,504 legs