Answer based on context:

Osman II designated Öküz Mehmed Pasha once again for the eastern front. Abbas learnt the Ottoman plan was to invade via Azerbaijan, take Tabriz then move on to Ardabil and Qazvin, which they could use as bargaining chips to exchange for other territories. The shah decided to lay a trap. He would allow the Ottomans to enter the country, then destroy them. He had Tabriz evacuated of its inhabitants while he waited at Ardabil with his army. In 1618, an Ottoman army of 100,000 led by the grand vizier, invaded and easily seized Tabriz. The vizier sent an ambassador to the shah demanding he make peace and return the lands taken since 1603. Abbas refused and pretended he was ready to set fire to Ardabil and retreat further inland rather than face the Ottoman army. When the vizier heard the news, he decided to march on Ardabil right away. This was just what Abbas wanted. His army of 40,000 commanded by Qarachaqay Khan was hiding at a crossroads on the way and they ambushed the Ottoman army in a battle at Sarab on 10 September 1618, which ended in complete victory for the Iranians. The beylerbeys of Rumelia, Diyarbakır and Van were among thousands who lost their lives. The new Grand Vizier Damat Halil Pasha took command, continued the invasion. When the Ottoman army started to threaten Ardabil the Safavids sued for peace. The terms of the treaty was similar to those of treaty of Nasuh Pasha with several minor rectifications of the border line. Also, the annual tribute of the Persian side was reduced from 200 loads to 100 loads of silk.

How many Iranians fought against the Ottomans?
40000