On Father's Day, a father received a box of low-sugar cup cakes. He decided to share it with his family. He gave half of the cakes to his wife, half of what remained to his first child, half of what was still left to his second child, and half of what was then left to his third child. After sharing, he noticed there was exactly 2 cup cakes left for himself.
How many cup cakes did the box originally have?