Philadelphia has been stricken with Hamilton mania since last month, when hundreds of fans queued up online and in front of the Forrest Theatre box office on Walnut Street as they waited for a chance to spend up to $497 per ticket.

But some fans will be able to get into the hit Broadway musical, running here from Aug. 27 to Nov. 17, for much, much cheaper.

Producers today announced details for a digital ticket lottery that will make 40 $10 tickets available for each performance of Hamilton’s Philadelphia run this fall. The lottery, organizers said, will open at 11 a.m. two days before each performance, beginning Sunday, Aug. 25 for Tuesday’s opening show. Entries will be cut off at 9 a.m. the day before each performance.

To enter, fans can register via the official Hamilton app, which is available via the Apple App Store and Google Play Store, or through the official Hamilton website, both starting on Sunday. Participants must be at least 18 years old.

Those who enter the lottery will be notified whether they were randomly selected to purchase tickets via email and text message by 11 a.m. the day before their selected performance. The lucky lottery winners will be able to purchase up to two tickets for $10 apiece online.

Lottery winners who purchase tickets can pick up their passes at the Forrest Theatre box office starting 90 minutes before showtime. A valid photo ID is required, and tickets may not be resold.

Regular tickets for some of the show’s Philly performances are still available and run between $127 for regular tickets to $497 for premium seats. Initial ticket sales, which started in Philly in early July, resulted in long lines outside the Forrest, and even longer lines numbering in the tens of thousands for digital sales, prompting some online complaints from fans.

“It hyped me up more,” one fan waiting in line for tickets told the Inquirer last month. “I said, ‘This s- must be something.’”