A number of designs and products exist to add more I/O pins to the Arduino Uno or Mega
These pins can be Analog Inputs / Digital Inputs / Digital Outputs
3 x 16 ports with output latch
Part # DEV-11723
https://www.sparkfun.com/products/11723
https://mayhewlabs.com/products/mux-shield-2
https://mayhewlabs.com/products/arduino-mux-shield
1 x 16 ports without output latch
Part # BOB-09056
https://www.sparkfun.com/products/9056