Passage: In 1629, the Ottomans, having secured peace with the Habsburgs, mustered their forces for another offensive under the new and capable Grand Vizier Gazi Hüsrev Pasha. A severe winter and heavy floods made operations in central Iraq impossible, and Hüsrev turned his army east instead, invading Persia proper. On 4 May 1630 he routed the Persians under Zainal Khan Begdeli Shamlu in battle at Mahidasht near Kermanshah and proceeded to sack the city of Hamadan. Hüsrev Pasha then turned back towards Baghdad and besieged it in November. However the siege had to be lifted soon, as the onset of another heavy winter threatened his lines of communication. In the wake of his withdrawal, the Persians re-established their control of Iraq, and subdued the rebellious Kurdish populations. The next few years saw constant raiding and skirmishes, without either side claiming any decisive advantage. Shah Safi (r. 1629–42) sent a peace delegation to the Ottoman court, but the new Grand Vizier, Tabanıyassi Mehmed Pasha, rejected its demands. The Caucasian front of the Persians flared up again in 1633, when the restless Georgian kingdoms of Kartli and Kakheti, under the rule of King Teimuraz, defied Safavid sovereignty. In 1634, Rustam Khan, a Georgian convert to Islam, was sent by the Shah to subdue them. Teimuraz was defeated, but managed to escape to safety in Imereti. He would nevertheless manage to restore himself on the throne of Kakheti in 1638, and even win Persian recognition of this fact.In 1635, in a conscious effort to emulate his warrior predecessors, Sultan Murad IV himself took up the leadership of the army. The Ottomans took Revan (on 8 August) and plundered Tabriz. The victorious Sultan returned in triumph to Constantinople, but his victories were short-lived: in the spring of the next year, Shah Safi retook Revan and defeated an Ottoman army. Renewed Persian peace proposals failed, and in 1638, Murad IV again personally led an army against Baghdad. The city fell in December after a siege of 39 days, effectively...

Question: How many days did it take the Ottomans to gain control of Baghdad?
39