Affine Cipher Keys that map plaintext to a given ciphertext
Assuming plaintext and ciphertext alphabets are $U=\{0,\ldots,25\}$, taken to be the ring of integers modulo 26, and the keyspace is $U^2$ with $$(a,b)\in U^2,$$ it is clear that for plaintext $x=2t$ corresponding to even numbers,  $(a,b)$ and $(a+13,b)$ give the same $y$ violating the invertibility of the encryption. Moreover, if $b=0$ $a$ can't be zero for the same reason. 

So we allow all $b$ but only $12$ nonzero $a$'s and can choose either $a$ or $a+13$ as $a$ ranges over $\{1,2,\ldots,12\}$.