Adam is carrying a box full of textbooks for his teacher. It contains math books, which weigh 3 pounds each, and history books, which weigh 2 pounds each. There are 30 books in the box. The total weight, not counting the box itself, is 77 pounds. How many math books are there?

There are _____ math books.