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

eeprom.read() reads a single byte; it's easier to use eeprom.get() which can read any data type (just like eeprom.put() can write any data type).