@@ -0,0 +1,566 @@
+#!/bin/python3%0A%0Aimport sys%0A%0Adef solution(s):%0A    pattern   = '010'%0A    positions = %5B%5D%0A    index     = s.find(pattern)%0A    %0A    while index %3E= 0:%0A        positions.append(index)%0A        index = s.find(pattern, index + 1)%0A    %0A    count = 0%0A    index = 0%0A    %0A    while index %3C len(positions):%0A        count += 1%0A              %0A        if index + 1 %3C len(positions) and abs(positions%5Bindex%5D - positions%5Bindex + 1%5D) %3C len(pattern):%0A            index += 1%0A%0A        index += 1%0A        %0A    return count%0A    %0An = int(input())%0AB = input().strip()%0Ac = solution(B)%0A%0Aprint(c)%0A

Create solution.py