#!/usr/bin/env python3 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # %% N = [int(x) - ord('0') for x in read().rstrip()] # %% dp_0 = 0 dp_1 = 1 for x in N: if x == 0: dp_0, dp_1 = dp_0, min(1 + dp_1, 1 + dp_0) else: dp_0, dp_1 = min(1 + dp_0, 1 + dp_1), dp_1 print(dp_0)