In the reaction given below, the total number of atoms having \( \text{sp}^2 \) hybridization in the major product \( P \) is \( \_\_\_\_\_ \).