Try replacing one counter with a shift register.