Frequency Counter with LCD display - complete code

It's great that you made this from scratch. That's certainly a great learning experience.

But you really should have considered the FreqCount library. It avoids any dead time between gate intervals, so you never have a blind time. A count missed right after the end of one interval will be picked up in the next. The FreqCount library is also portable and supports multiple chips. It works automatically on Leonardo and Teensy, and will likely support other boards in the future, whereas hard-coding the AVR timer registers results in a sketch that's tightly bound to only Arduino Uno.