$i$ bits $(0/1)$ are used for an instruction. So, total number of encodings possible $=2^i.$
The address bits are part of instruction bits. For $1-$address instructions there are $a$ address bits and for $2-$ address instructions there are $2a$ address bits.
So, $y$ one address instructions will take $y \times 2^{a}$ encodings (address change won’t count as a new instruction) and
$x$ two address instructions will take $x \times 2^{2a}$ encodings.
So, remaining encodings (which are free for $0-$ address instructions) $ = 2^i – (y \times 2^a) –( x \times 2^{2a})$