import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();

        System.out.println(solve(S, K));

        sc.close();
    }

    static char solve(String S, long K) {
        for (int i = 0; i < K - 1; ++i) {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        }

        return S.charAt((int) K - 1);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();

        System.out.println(solve(S, K));

        sc.close();
    }

    static char solve(String S, long K) {
        for (int i = 0; i < K - 1; ++i) {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        }

        return S.charAt((int) K - 1);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();

        System.out.println(solve(S, K));

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();

        System.out.println(solve(S, K));

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc System.out.println(solve(S, K)) System.out.println System.out System System.out solve(S, K) solve S K sc.close() sc.close sc String[] args args static char solve(String S, long K) {
        for (int i = 0; i < K - 1; ++i) {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        }

        return S.charAt((int) K - 1);
    } solve {
        for (int i = 0; i < K - 1; ++i) {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        }

        return S.charAt((int) K - 1);
    } for (int i = 0; i < K - 1; ++i) {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        } int i = 0; int i = 0; i 0 i < K - 1 i K - 1 K 1 ++i ++i i {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        } {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        } char ch = S.charAt(i); ch S.charAt(i) S.charAt S i if (ch != '1') {
                return ch;
            } ch != '1' ch '1' {
                return ch;
            } return ch; ch return S.charAt((int) K - 1); S.charAt((int) K - 1) S.charAt S (int) K - 1 (int) K 1 String S S long K K public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();

        System.out.println(solve(S, K));

        sc.close();
    }

    static char solve(String S, long K) {
        for (int i = 0; i < K - 1; ++i) {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        }

        return S.charAt((int) K - 1);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();

        System.out.println(solve(S, K));

        sc.close();
    }

    static char solve(String S, long K) {
        for (int i = 0; i < K - 1; ++i) {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        }

        return S.charAt((int) K - 1);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        long K = sc.nextLong();

        System.out.println(solve(S, K));

        sc.close();
    }

    static char solve(String S, long K) {
        for (int i = 0; i < K - 1; ++i) {
            char ch = S.charAt(i);
            if (ch != '1') {
                return ch;
            }
        }

        return S.charAt((int) K - 1);
    }
}