To find the number of pigs, we need to determine the number of chickens first.
Let's assume the total number of barn animals is represented by 'x'. Since 1/3 of the animals are chickens, we can calculate the number of chickens as (1/3) * x.
Next, we need to calculate the number of pigs. Since the remaining animals are pigs, their count is (2/3) * x.
Now, we know that each chicken has 2 legs and each pig has 4 legs. As there were a total of 20 legs in the barn, we can write the equation:
(2 * (1/3) * x) + (4 * (2/3) * x) = 20
Simplifying this equation will give us the value of 'x', which represents the total number of barn animals. From there, we can calculate the number of pigs.