NEW YORK - How to get to "Sesame Street" is child's play, as the chirpy theme song has assured kids daily for 39 years.

But first it had to be created. In the new book "Street Gang: The Complete History of 'Sesame Street' " (Viking Adult, $27.95), journalist Michael Davis takes us on the journey with thoroughness and obvious affection.

While this history travels some familiar ground, the story in its fullness should cause readers to marvel at what a charmed alignment "Sesame Street" represents: Here, an era of social activism coincided with a strategy for channeling TV to help underprivileged youngsters, which all led to this newfangled show, along with an institution (now called Sesame Workshop) to cradle it.

An early outline for the show had already identified the essentials: It would be a daily hourlong program for 3- to 5-year-olds, shot on tape, with music, puppets and stories. The goal: to help kids learn their ABCs and count from one to 10.

Other details weren't so quickly nailed down, like who might air it. According to "Street Gang," both CBS and NBC had a chance, but each rejected the project.

"All the applause, all the gratitude from parents, all the awards and recognition," plus millions from licensing and merchandising - this was for the taking by either network. As Davis writes, "Turning down 'Sesame Street' was a billion-dollar blunder."

It debuted instead on PBS on Nov. 10, 1969, and from its first day, the show made everything look easy - including itself.

But the four years before that had been jammed with brainstorming, fundraising, meticulous research and remarkable invention. One major "aha!" moment: the decision to teach numbers and letters with parody commercials. It was a revolutionary idea then and an educational hallmark ever since.

A few decisions were made on the fly. Casting of actors was somehow put off until shortly before its test shows had to be taped.

Then came another vexing issue.

"We were just frantic for a title," recalled series mastermind Joan Ganz Cooney. No one much liked the word "sesame," which seemed to imply opening something up, but also seemed cutesy and doomed to be mispronounced by the audience as "see-same."

But the deadline was upon them. "We decided that 'Sesame Street' was the least bad" of the options, Cooney said.

If they were frantic, no wonder. Any miscalculation with this "Street" could have meant its abrupt dead end, dooming it as just another case of good intentions gone awry. History includes an element of suspense in "Street Gang," which never lets the reader forget that success was anything but guaranteed.

The core of the story belongs to Cooney. "Sesame Street" was her vision, and she would nurture it for decades to come, defying her skeptics' initial doubts - she was young, had no experience in children's TV and was a woman.

Another narrative strand dwells on the Muppet world of Jim Henson (who, we learn, began his career with no particular interest in puppeteering: "I did it to get on television").

The book charts children's TV in its infancy, as well as puppetry entering the TV age in the hands of Burr Tillstrom ("Kukla, Fran and Ollie"), and the puppets on "Howdy Doody" and "Captain Kangaroo."

The book also covers early public television (then, as ever, an unwieldy, perplexing contraption). And it invokes the 1960s idealism that ignited "Sesame Street" and remains a fundamental part. After all, the show is set in an inner-city neighborhood of impressive diversity where everybody gets along.

With its premiere, "Sesame Street" was not only an instant success, but also wildly acclaimed. For example, famed pediatrician and liberal activist Dr. Benjamin Spock predicted that the show would mean "fewer unemployables in the next generation, fewer people on welfare and smaller jail populations."

That ecstatic logic suggests that, by now, "Sesame Street" should have virtually put itself out of business. Instead, the needs of children are undiminished as "Sesame Street" stretches on. "Street Gang" is a fascinating account of what paved the way. *