Fun fact
if f(a)=b then f⁻¹(b)=a
so
if f⁻¹(b)=a then f(a)=b
so we find f(x)=27 and the solve for x
f(x)=3x=27
3x=27
divide both sides by 3
x=9
so if f(9)=27 then f⁻¹(27)=9
problem solved
answer is 9
There could be lots of answers. I'm going with 5 goats and 7 ducks.