Thankfully, they were in a minimum-security cell, where there would be some petty criminals like thieves, child abusers, smugglers etc. In this section, there aren’t many dementors. James knew that in this section, there are one, two, but maximum three dementors and they wouldn’t suffer the dementor’s exposure like in the higher-level parts of Azkaban.