It is 1794 and Paris, "despite the horrors that had stained her walls - has remained a city of pleasure, and the knife of the guillotine did scarce descend more often than did the drop-scenes on the stage."
The plot begins when Sir Percy, the Scarlet Pimpernel, reluctantly agrees to take Armand St. Just, brother of his wife, Marguerite, with him to France as part of a plan to rescue the young Dauphin.
Percy warns Armand not to renew any friendships while in Paris, but it doesn't take long before Armand has ignored his warnings and renewed a friendship with the scheming Baron de Batz (in the pay of the Austrian government), who wants to free the Dauphin himself and despises the Scarlet Pimpernel and all he represents.
Whilst attending the opera with De Batz, Armand foolishly tells him that he is in the league of the Scarlet Pimpernel. While there, he falls in love with a young actress named Citizeness Jeanne L'Ange. De Batz introduces the couple backstage at the theatre and once they have fallen for each other, De Batz tells Citizen Heron of the general committee of Public Safety where and when they have arranged to meet.
After covering for Armand at her house, L'Ange is arrested and thrown into jail. Learning of her peril and in the throes of passion, Armand fails to trust Sir Percy who has told him that he will rescue Jeanne, and forgets his promise to his leader.
Armand, desperate to share Jeanne's fate, runs to the gate of the Temple prison and screams, "Long Live the King." There he's intercepted by none other than Percy's arch enemy, Chauvelin.
Faced with the death of his love, Armand betrays Percy, unaware that The Pimpernel has already secured Jeanne's freedom. Sir Percy is then captured and imprisoned by Chauvelin and Heron in the cell that was home to Marie Antoinette in her last days.
Chauvelin insists that Percy is to be deprived of sleep in the hope that he will be weakened and disclose where young Capet, the uncrowned King of France, is being held following his rescue.
After 17 days in prison, Percy is sure that the dauphin has been transported safely into Holland. He then contrives, by pretending to crack and confess the dauphin's whereabouts, to make his escape. He tells Chauvelin and Heron that the dauphin is being held in an area in the north, near the coast of France, but that he has to show them, rather than tell them, because the paths are nameless and too small for them to find without him.
Chauvelin and Heron, skeptical, bring along Armand and Marguerite as hostages. Once in the north, Percy takes advantage of a chance when Chauvelin and Heron are separated, and darkness, to subdue Heron, bind and truss him, put on his clothes, and direct the guileless French soldiers (who think that the bound Heron is Percy) to put him in the gated yard of a church. Percy, still thought to be Heron, drives a carriage with Marguerite and Armand inside to the coast, where his ship is waiting for them.

Question: How many days does Sir Percy remain in prison for before pretending to crack?
Answer: 17 days.
Alternative answer: 17