Take time to exercise the following tutorial in order to acquire knowledge on how to count the HIGH states of incoming pulses and then store them into the internal EEPROM the ATmega328P MCU of the UNO Board.
1. Let us try to count the HIGH states of a known frequency pulse train; where, a pulse count of about 176/177 per minute will be fed at DPin-13. The pulses will be automatically coming from DPin-9 of the UNO. Therefore, short DPin-13 and DPin-9 with a jumper wire as per circuit of Fig-1.

Figure-1:
2. Upload the following sketch and check that L (built-in LED of UNO) blinks indicating that pulses are coming from DPin-9. Also, observe that the Serial Monitor shows about 176/176 figure at 1-min interval.
int highCounter = 0;
void setup()
{
Serial.begin(9600);
pinMode(13, INPUT);
//--the following codes generate pulses at DPin-9------------------
TCCR1A = 0x00;
TCCR1B = 0x00;
bitClear(TCCR1B, WGM13);
bitSet(TCCR1B, WGM12);
bitClear(TCCR1A, WGM11);
bitClear(TCCR1A, WGM10);
bitClear(TCCR1A, COM1A1);
bitSet(TCCR1A, COM1A0);
pinMode(9, OUTPUT);
OCR1A = 42499; //sets the initial frequency about 2.9 Hz
TCNT1 = 0x0000;
bitClear(TCCR1B, CS12);
bitSet(TCCR1B, CS11);
bitSet(TCCR1B, CS10);
}
void loop()
{
unsigned long int prMillis = millis();
while (millis() - prMillis < 60000UL)//count HIGH states until 1-min is elapsed
{
if (digitalRead(13) == HIGH)
{
highCounter++; //HIGH state is found; increment pulse counter, hightCounter
while (digitalRead(13) != LOW)
{
; //wait unntil pulse goes to LOW state
}
}
}
Serial.println(highCounter);
highCounter = 0;
}
3. Study the codes of the loop() function of the sketch of Step-2 to see how the HIGH states of the incoming pulses are being counted over 1-minute time using millis() function.
4. Now add/insert the following codes at the appropriate places of the sketch of Step-2 for the storage/retrieval of the counts (value of highCounter) into EEPROM.
#include<EEPROM.h>
int readCounter = 0;
EEPROM.put(0x0010, highCounter); //store data > 1 byte
EEPROM.get(0x0010, readCounter); //retrieve data from EEPROM
Serial.print("Reading from EEPROM: ");
Serial.println(readCounter);
5. Now based on the above tutorial, adjust the codes of your original sketch of post #1 and make that running.