Module Module1

    Sub Main()
        'let
        Dim S = Console.ReadLine()
        Dim K As Long = Console.ReadLine()
        Dim tmp = S.Replace("1", "")

        'var
        Dim i As Long = 0

        Do While i < Len(S)
            If S(i) <> "1" Then Exit Do
            i = i + 1
        Loop

        If K - 1 < i Then
            Console.WriteLine(1)
        Else
            Console.WriteLine(tmp(0))
        End If

    End Sub

End Module