Total number of functions =35
(since each of 1,2,3,4 or 5 can correspond to any of a,b or c )
The number of functions that corresponds to only one element of B is 3C1×15 and the number of functions that correspond to atmost two elements of B is 3C2×25.
Total number of onto functions =35−3C2×25+3C1×15=243−96+3=150 (3C1×15isrepeatedtwicein()3C2×25)