Option Strict On
Module Module1

    Sub Main()
        Dim s As String = Console.ReadLine()
        Dim len As Integer = Strings.Len(s)
        ' Console.WriteLine(len)
        'Console.ReadLine()
        Dim counter0 As Integer = 0
        Dim counter1 As Integer = 0
        Dim color As String = "0"
        For i As Integer = 0 To len - 1
            If Mid(s, i + 1, 1) <> color Then
                counter0 += 1
            End If
            If color = "0" Then
                color = "1"
            Else
                color = "0"
            End If
        Next
        color = "1"
        For i As Integer = 0 To len - 1
            If Mid(s, i + 1, 1) <> color Then
                counter1 += 1
            End If
            If color = "0" Then
                color = "1"
            Else
                color = "0"
            End If
        Next
        If counter0 < counter1 Then
            Console.WriteLine(counter0)
        Else
            Console.WriteLine(counter1)
        End If
        Console.ReadLine()
    End Sub

End Module