After the sunset and Alec, they meet the Dodecahedron, a figure having twelve faces. Each of them express a different emotion. He takes them to the Mathemagician, who shows them the Numbers Mine, where the world's digits are pulled from the earth like jewels. This is the equivalent to the letter market in Dictionopolis. In the mine, Milo and company was served subtraction soup, where the more you ate, the more it made you hungrier. Past the way to infinity, Milo tricks the Mathemagician into agreeing with his brother to release the princesses. So the Mathemagician takes them to the edge of the Mountains of Ignorance, and provides Milo with a magic wand which was really only a pencil.
Once in the mountains, the three encounter many demons. The first is the Everpresent Wordsnatcher, an ugly birdlike creature who always interrupts. After the bird flew away, the continued down the path until they met the Terrible Trivium. He was the demon of useless and worthless jobs. The defeated him with the help of the demon of insecurity, who soon ran away because he was depressed that Milo outsmarted him. The defeated demons then aroused the whole population of their realm to pursue the travelers. With the demons close behind them, Milo and company climb to the Castle-in-the-Air, where the two princesses welcome Milo. The enraged demons, meanwhile, chop off the base of the staircase, causing the Castle to begin to float away. Because "time flies", Tock is able to carry the others safely back to earth, where the combined armies of Wisdom are waiting. The armies then defeat the demons. The two leaders welcome the princesses home and begin a celebration to mark their return.
Milo thereafter returns home. He learns that the entire adventure, which seemed to him weeks long, has only lasted an hour.