Some children shared some mini cupcakes among themselves. They tried taking 9 mini cupcakes each, but found that the last child had only 8 mini cupcakes. When each child took 7 mini cupcakes, there were 13 mini cupcakes left over. How many mini cupcakes were there in all?