From the scrum guide, the optimal development team size is 3 to 9 members. I have however read that the ideal team size is between 5 and 9. I am quoting the line I read from an online article.
the recommended Agile team size is 7 +/- 2. That means the ideal team size is between 5 and 9.