Count clicks two instruments

I have some problems with a new game I want to make for my website. Users have to click several times on two instruments, in order to open a gate somewhere else on the site. The instruments are two drums. To open the gate, you must click first on the big drum, then two times on the smaller drum, then again on the big one and at last one time at the small one. Then you hear a sound and the gate will open.

I want to know, is it possible to count the different clicks and reset the counter if the user clicks on the wrong drum?