s = input() ans = 0 for i in range(1, len(s) - 1): if s[i] != '0' and s[i-1] == '0' and s[i+1] == '0': ans += 1 print(ans)