How many words exist in the format of the simple precision IEEE 754 standard to represent the NaN value?
From this link you should be able to come up with a general solution: https://en.m.wikipedia.org/wiki/IEEE_754-1985
Why should it be general? Because it could work for both 32 and 64 bit numbers. The sign is X, the exponent is Y, the fraction is anything but all P's.
You just need to fill in X, Y, P (which is found on the wikipedia page) and come up with a general formula. This is a combinatorics problem. How many ways can you construct a binary string of size N that is not all zeros?