Let $z$ be a complex number with $|z| = \sqrt{2}.$  Find the maximum value of
\[|(z - 1)^2 (z + 1)|.\]The answer is in the form k\sqrt{m}+n,. Please provide the value of k + m + n.

Let's think step by step and output the final answer within \boxed{}.
user