Architect Peter Mitchell (Tom Selleck), cartoonist Michael Kellam (Steve Guttenberg), and actor Jack Holden (Ted Danson) are happy living their lives as bachelors in their lofty New York City apartment where they have frequent parties and flings with different women. Their lives are disrupted when a baby named Mary arrives on their doorstep one day. A note with her, written by a lady named Sylvia, indicates that she is Jack's, the result of a tryst between the actor and actress. Mary arrives in his absence   he is in Turkey shooting a B movie, leaving Peter and Michael to fend for themselves in taking care of her. Prior to leaving, Jack had made arrangements with a director friend to have a "package" delivered to the apartment as a favor. Before Mary's arrival, he calls and leaves a message with Peter and Michael informing them of it and to keep it a secret per the director friend's wishes. When she arrives, they mistakenly believe she is "the package", even though there is a note from her mother.
Peter and Michael are totally befuddled on how to care for Mary, and Peter leaves to go buy whatever supplies are needed. While he is gone, Mrs. Hathaway (Cynthia Harris), the landlady, delivers a small box (which is the actual "package" containing heroin) to the apartment and Michael tosses it aside while trying to keep Mary under control. After Peter returns, they eventually figure out her proper care, right down to diaper changes, baths, and feedings.
The next day, two men (who are drug dealers) arrive at the apartment to pick up the package. Peter and Michael mistakenly give Mary to them instead, and shortly after they leave, Peter discovers the actual package. He runs downstairs to intercept them, but trips and stumbles, and the package's contents spill. He gathers it and retrieves Mary from them, but retains the heroin while allowing them to take a can of powdered milk. After the exchange, a police officer attempts to ticket them for illegal parking, but they escape. He accosts Peter and detains him in the apartment until Sgt. Melkowitz (Philip Bosco), a narcotics officer, arrives to question him and Michael about the drugs. They successfully hide them from him during the interrogation, in which they learn that Jack's friend is a drug dealer as well. He leaves with suspicions and puts them and the apartment under surveillance.
Peter and Michael are able to persuade Mrs. Hathaway to babysit Mary while they work. Once they get home, however, they find her bound and gagged and the apartment ransacked, apparently by the dealers demanding the heroin. Mary is safe, however. They continue with their care of her, adjusting to surrogate fatherhood and growing attached to her, until Jack returns.
Once Jack returns, Peter and Michael question him about the entire drug deal and Mary. He replies that he knew nothing about the heroin and initially denies everything about Mary until he reads the note from Sylvia. He then recalls the tryst that eventually led to her being born. Peter and Michael do not hesitate in taking their revenge and passing all responsibility of looking after her to him, but he quickly grows to love her.
Later, Peter discovers in the mail a news clipping of Jack's director friend being hospitalized after a mugging (presumably by the drug dealers), with a handwritten note, "Don't let this happen to you." They formulate a plan to meet and trap them when they negotiate a deal to deliver the illicit goods. With a recording of the conversation, they prove their innocence to Melkowitz and the dealers are arrested.
By now, they have fully embraced their role as Mary's guardians. However, one morning, Sylvia (Nancy Travis) arrives, asking for her back intending to take her to London to live with her family. Handing her over, they quickly find themselves miserable and desperately missing her. Deciding to stop her and Sylvia from leaving, they rush to the airport to try and persuade the latter to stay, but they arrive just as her plane is backing up from the gate. Defeated, they return home, where they find both Mary and Sylvia, who did not go to London after all. Sylvia tearfully explains she doesn't want to give up her acting career but can't do so if she has to raise Mary alone, so Peter quickly invites her and Mary to move in with them with Jack and Michael's agreement, and she agrees.
Output: What does Peter leave to go buy?