import java.math.BigInteger;
import java.util.Scanner;

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

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

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

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

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