Connect the dip switch to a 74165 type shift register and stream the bits in via 3 lines.

Jerson