Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) says that the Messenger of Allah (peace and blessings be upon him) took four hundred as the ransom of the captives of the people of Jahiliyyah.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18041