import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        int i = 0;
        while (s.charAt(i) == '1') {
            k--;
            if (k == 0) {
                System.out.println('1');
                return;
            }
            i++;
        }

        System.out.println(s.charAt(i));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        int i = 0;
        while (s.charAt(i) == '1') {
            k--;
            if (k == 0) {
                System.out.println('1');
                return;
            }
            i++;
        }

        System.out.println(s.charAt(i));
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        int i = 0;
        while (s.charAt(i) == '1') {
            k--;
            if (k == 0) {
                System.out.println('1');
                return;
            }
            i++;
        }

        System.out.println(s.charAt(i));
    } main {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        int i = 0;
        while (s.charAt(i) == '1') {
            k--;
            if (k == 0) {
                System.out.println('1');
                return;
            }
            i++;
        }

        System.out.println(s.charAt(i));
    } 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 int i = 0; i 0 while (s.charAt(i) == '1') {
            k--;
            if (k == 0) {
                System.out.println('1');
                return;
            }
            i++;
        } s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
            k--;
            if (k == 0) {
                System.out.println('1');
                return;
            }
            i++;
        } k-- k if (k == 0) {
                System.out.println('1');
                return;
            } k == 0 k 0 {
                System.out.println('1');
                return;
            } System.out.println('1') System.out.println System.out System System.out '1' return; i++ i System.out.println(s.charAt(i)) System.out.println System.out System System.out s.charAt(i) s.charAt s i String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        int i = 0;
        while (s.charAt(i) == '1') {
            k--;
            if (k == 0) {
                System.out.println('1');
                return;
            }
            i++;
        }

        System.out.println(s.charAt(i));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        int i = 0;
        while (s.charAt(i) == '1') {
            k--;
            if (k == 0) {
                System.out.println('1');
                return;
            }
            i++;
        }

        System.out.println(s.charAt(i));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        int i = 0;
        while (s.charAt(i) == '1') {
            k--;
            if (k == 0) {
                System.out.println('1');
                return;
            }
            i++;
        }

        System.out.println(s.charAt(i));
    }
}
