Answer:
81 sheep were there on the farm
Explanation:
Consider the provided information.
Let x represents the number of goats.
y represents the number of cows.
z represents the number of sheep.
Therefore, the total number of animals are x+y+z
2/5 of the animals were goats. This can be written as:

There were three times as many sheep than cows.

There were 45 more goats than cows,

Substitute the value of x and z in equation 1.





Hence, there are 27 cows.
Substitute the value of y in



Therefore, there are 72 goats.
Substitute the value of y in



Thus, there are 81 sheep.