Did this couple of days ago. I had lot of spams in my gmail account and number of unread mails were more than 1000. Using following steps, you can bring the unread mails count to 0.
- In the search box, type “is:unread”
- In the select area press “All”
- A link will appear that says “Select all conversations that match this search”, press it
- From the drop down, select “Mark All as Read”.