This is the schematic of the counter: