Given,
R=a,b,c,d,e and S=1,2,3,4

Now taking, f(a)=1 we get, one of f(b),f(c),f(d),f(e)=1 then total such cases =4⋅3!=24
Now if, only f(a)=1, then we have distribute 2,3,4 amongst b,c,d,e,
So, total cases =34−(C13⋅24)+(C23⋅1)
=36
So, number of onto functions when f(a)=1 is 24+36=60
Now finding, total number of onto functions,
=45−(C14⋅35)+(C24⋅25)−(C34⋅1)
=1024−973+192−4
=240
Number of required functions when f(a)=1 will be,
=240−60=180