74hc165 is another alternative. Should be very cheap to buy but each chip has only 8 inputs.
Using Megas as simple I/o expanders is wasteful and requires multiple sketches to be written, maintained and uploaded.
What kind of proximity sensors are these? Perhaps a matrix would be possible.