A thief plans to break into a castle, but unfortunately, it is surrounded by a moat that the thief cannot possible swim through. The only way they can hope to get in is through the main entrance, where a huge guard stands. The thief knows that they cannot best the guard in combat, so they decide to wait and see how others get into the castle.
A nobleman approaches the guard, and the guard challenges, asking "6?"
The nobleman replies "3," and the guard lets him pass.
The thief nods, but continues to observe.
Next, a noblewoman approaches. The guard asks "12?"
She replies, "6," and the guard allows her to pass.
The thief, confident that they understand how to get past the guard, approaches. The guard challenges "16?"
The thief replies, "8." The guard immediately seizes the thief and throws them in the dungeon for having the wrong password. What was the correct response?