Boxes in Boxes

Inside a large box are six smaller boxes. Some of these smaller boxes are empty, and others have six very small empty boxes inside them. Thirty-one boxes in all are present. How many of these thirty-one boxes are empty?

(Source: Mathematics Teaching in the Middle School, Jan 1998)