Less than 12 to my ears.
I always observed that the number of random non-musicians who can get it right using the "major" handful of those twelve keys is remarkable enough to be considered.
Since those are the only 12 notes so many people have been hearing from every direction for so long, and truly confined to not more than a few of the major keys that are "dominant" as a result of modern instrumentation, it gets ingrained in the psyche and the notes are almost memorized by frequency. With nothing in-between, so that's what they reproduce without any training. Or can have a more sensitive ear for out-of-tune notes than an actual music student of a number of years.
I agree, it doesn't happen magically.
It just happens about any time naturally.