Count ordered triples \((a, b, c) = (f(1), f(2), f(3))\) of distinct elements of \(A\) with \(a + b + c = 3\).
Any three distinct non-negative integers have sum at least \(0 + 1 + 2 = 3\), with equality only for the set \(\{0,1,2\}\). Any other set has a larger sum. So the unordered set is \(\{0,1,2\}\) and there are \(3! = 6\) ordered triples.
Once \(f(1), f(2), f(3)\) are fixed, the other five domain points can be matched to the five unused codomain values in \(5! = 120\) ways.
Number of functions \(= 6 \cdot 120 = 720\).
Answer: 720