Help on momentary push switches in series.

So you have a 20-IO pin device, you need 13, you need to be able to detect multiple key presses.
How does adding an R2R ladder help here?