For how many ordered triples $(x, y, z)$ of nonnegative integers less than $20$ are there exactly two distinct elements in the set $\{i^x, (1 + i)^y, z\}$, where $i = \sqrt{-1}$?

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