import java.util.Scanner;

class Main {
    static String S;

    public static void main(String... args) {
        Scanner IN   = new Scanner(System.in);
        S = IN.next();
        long K = IN.nextLong();
        System.out.println(calc(K, 0));
    }

    static Character calc(long k, int i) {
        if (k == 1) {
            return S.charAt(i);
        } else {
            if (S.charAt(i) != '1') {
                return S.charAt(i);
            } else {
                return calc(k - 1, i + 1);
            }
        }
    }
} import java.util.Scanner; Scanner java.util class Main {
    static String S;

    public static void main(String... args) {
        Scanner IN   = new Scanner(System.in);
        S = IN.next();
        long K = IN.nextLong();
        System.out.println(calc(K, 0));
    }

    static Character calc(long k, int i) {
        if (k == 1) {
            return S.charAt(i);
        } else {
            if (S.charAt(i) != '1') {
                return S.charAt(i);
            } else {
                return calc(k - 1, i + 1);
            }
        }
    }
} Main static String S; S public static void main(String... args) {
        Scanner IN   = new Scanner(System.in);
        S = IN.next();
        long K = IN.nextLong();
        System.out.println(calc(K, 0));
    } main {
        Scanner IN   = new Scanner(System.in);
        S = IN.next();
        long K = IN.nextLong();
        System.out.println(calc(K, 0));
    } Scanner IN   = new Scanner(System.in); IN new Scanner(System.in) S = IN.next() S IN.next() IN.next IN long K = IN.nextLong(); K IN.nextLong() IN.nextLong IN System.out.println(calc(K, 0)) System.out.println System.out System System.out calc(K, 0) calc K 0 String... args args static Character calc(long k, int i) {
        if (k == 1) {
            return S.charAt(i);
        } else {
            if (S.charAt(i) != '1') {
                return S.charAt(i);
            } else {
                return calc(k - 1, i + 1);
            }
        }
    } calc {
        if (k == 1) {
            return S.charAt(i);
        } else {
            if (S.charAt(i) != '1') {
                return S.charAt(i);
            } else {
                return calc(k - 1, i + 1);
            }
        }
    } if (k == 1) {
            return S.charAt(i);
        } else {
            if (S.charAt(i) != '1') {
                return S.charAt(i);
            } else {
                return calc(k - 1, i + 1);
            }
        } k == 1 k 1 {
            return S.charAt(i);
        } return S.charAt(i); S.charAt(i) S.charAt S i {
            if (S.charAt(i) != '1') {
                return S.charAt(i);
            } else {
                return calc(k - 1, i + 1);
            }
        } if (S.charAt(i) != '1') {
                return S.charAt(i);
            } else {
                return calc(k - 1, i + 1);
            } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
                return S.charAt(i);
            } return S.charAt(i); S.charAt(i) S.charAt S i {
                return calc(k - 1, i + 1);
            } return calc(k - 1, i + 1); calc(k - 1, i + 1) calc k - 1 k 1 i + 1 i 1 long k k int i i
import java.util.Scanner;

class Main {
    static String S;

    public static void main(String... args) {
        Scanner IN   = new Scanner(System.in);
        S = IN.next();
        long K = IN.nextLong();
        System.out.println(calc(K, 0));
    }

    static Character calc(long k, int i) {
        if (k == 1) {
            return S.charAt(i);
        } else {
            if (S.charAt(i) != '1') {
                return S.charAt(i);
            } else {
                return calc(k - 1, i + 1);
            }
        }
    }
}
