The top-left hopper has one stack of items in it (it gives an output power of 3)
Comparators facing right are all in substraction mode.
Each lever flipped substracts 1 from the line. So if flipped 3 or more the lamp will be off (you can use a repeater instead). The order of levers does not matter.
This is genius!