8.

Convinced the show would be cancelled after the first season, the writers never allowed the Janitor to interact with a character other than J.D. so that they could reveal he was a figment of the young doctor's imagination in the final episode.