The shooter shoots at 3 targets until he shoots everything. The probability of a hit with one shot is \(p\).
a) Find the probability that he needs exactly 5 shots.
b) Find the mathematical expectation of the number of shots.