48 inputs and 48 ouputs with arduino mega

I am sorry for my mathematical error there.

I was thinking that I might need more interrupt pins but was not sure.

It seems like I have to think about something else.

Thank you for your help.