How to write a input counter data into EEPROM and retrieve it.?

Exactly as @mvpolo2k3 wrote. The loop runs many, many times in second. It depends on MCU's clock frequency, loop() length - number of instructions, interrupts, delays, sleep etc.

The DS1307 could be feasible for saving your data. It has 56 bytes of battery backed RAM with unlimited writes.