from machine import Pin 
from time import sleep 
sw=[Pin(13,Pin.IN,Pin.PULL_DOWN),Pin(12,Pin.IN,Pin.PULL_DOWN),Pin(14,Pin.IN,Pin.PULL_DOWN)]
led=[Pin(4,Pin.OUT),Pin(2,Pin.OUT),Pin(5,Pin.OUT)]
n=0
while True:
    if sw[0].value()==1:
        for i in range(n):
            led[0].value(1)
            led[1].value(1)
            led[2].value(1)
            sleep(1)
            led[0].value(0)
            led[1].value(0)
            led[2].value(0)
            sleep(1)
    elif sw[1].value()==1:
        n=n+1
        sleep(1)
        print(n)
    elif sw[2].value()==1:
        n=0 
        print(n)