Step 1: Know what a pi bond is.
A single bond is one sigma bond. A double bond is one sigma plus one pi. A triple bond is one sigma plus two pi bonds. So we just find the multiple bonds and count their pi parts.
Step 2: Handle ethene $C_2H_4$.
Its structure is $CH_2=CH_2$, with one carbon-carbon double bond. A double bond has one pi bond, so $x = 1$.
Step 3: Handle ethyne $C_2H_2$.
Its structure is $HC\equiv CH$, with one carbon-carbon triple bond. A triple bond has two pi bonds, so $y = 2$.
Step 4: Handle cyanogen $C_2N_2$.
Its structure is $N\equiv C-C\equiv N$. There are two triple bonds, each giving two pi bonds, so $z = 2 + 2 = 4$.
Step 5: Add them up.
\[ x + y + z = 1 + 2 + 4 = 7. \]
Step 6: State the answer.
The total number of pi bonds is seven.
\[ \boxed{7} \]