Reading PIND and PINB

I just get the number 7 when nothing is attached.

Why are you reading pins with nothing attached?

Fare enough I thought but how should I continue if I want to read which pin has the highest frequency?

Seems to me like you need to compare the time each pin on the port goes high with when that pin goes low. The time taken doing that will far exceed the time required for a pin to go HIGH or LOW. So, I don't think there is a way for you to measure the frequency of all the pins simultaneously.