It is a 3 input EXOR GATE which produces an output 1 if all the inputs are 1 or exactly one input is 1.
We have 6 inputs - so possible combinations $=2^6 = 64$ as each of them can be either 0 or 1.
We get output 1 if all 3 inputs to the final EXOR gate is 1 or exactly one of them is 1.
- Lets take all 1's. This happens when $A_i \neq B_i$. So, 2 cases for each of the 3 EXOR gates - giving $2 \times 2 \times 2 = 8$ possible cases.
- Now, when we consider a single gate, it produces a 1 for 2 possible inputs out of 4, meaning 2 possibilities for 0. So, for say output 100, we have $2\times 2 \times 2 = 8$ possible inputs and same for outputs 010 and 001. Thus we get $8+8+8 = 24$ possible inputs.
Thus we get a 1 output for $8+24 = 32$ possible inputs.