You can use the one of the Timer/Counter module as a dedicated counter for this, at the cost of losing a few PWM outputs.
You can even use two Timer/Counters to operate in fractional frequency counting (e.g. whatever input signal that chip generates, and a 32768Hz reference clock from a DS3231 DTCXO RTC chip) And if you step up from ATmega328P to something that can be operated that fast a reference clock, you can use a 10MHz reference signal and commence timenutting (e.g. Rubidium standards)