How many 5-digit bank security Personal Identification Numbers (PIN) codes can be formed using the characters in the set {0, 2, 4, 6, 8, a, b, c, d, y } with the restrictions below.

Note: For purposes of this problem, the PIN number can be "padded" with zeros on the left. So a 0z01a is a good PIN. (IE, PIN codes can start with zeros.)

FYI: The 5-position pin above would rate as "weak" in most systems. Most of them require at least 8 characters from the digits, upper and lower case letters and special characters, and usually do not want a reused character!

Each part below is independent of the previous parts.

(a) PINs must use exactly three a's among the five characters. (with replacement)


(b) PINs begin with the letters a or d and can repeat characters. (with replacement)