import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        k--;

        for (long i = 0; i < s.length(); i++) {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        }

        System.out.println(s.charAt(s.length() - 1));
    }
} import java.util.Scanner; Scanner 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();
        k--;

        for (long i = 0; i < s.length(); i++) {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        }

        System.out.println(s.charAt(s.length() - 1));
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        k--;

        for (long i = 0; i < s.length(); i++) {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        }

        System.out.println(s.charAt(s.length() - 1));
    } main {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        k--;

        for (long i = 0; i < s.length(); i++) {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        }

        System.out.println(s.charAt(s.length() - 1));
    } 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 k-- k for (long i = 0; i < s.length(); i++) {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        } long i = 0; long i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        } {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        } if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            } s.charAt((int)i) != '1' s.charAt((int)i) s.charAt s (int)i '1' {
                System.out.println(s.charAt((int)i));
                return;
            } System.out.println(s.charAt((int)i)) System.out.println System.out System System.out s.charAt((int)i) s.charAt s (int)i return; if (i == k) {
                System.out.println(1);
                return;
            } i == k i k {
                System.out.println(1);
                return;
            } System.out.println(1) System.out.println System.out System System.out 1 return; System.out.println(s.charAt(s.length() - 1)) System.out.println System.out System System.out s.charAt(s.length() - 1) s.charAt s s.length() - 1 s.length() s.length s 1 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();
        k--;

        for (long i = 0; i < s.length(); i++) {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        }

        System.out.println(s.charAt(s.length() - 1));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        k--;

        for (long i = 0; i < s.length(); i++) {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        }

        System.out.println(s.charAt(s.length() - 1));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long k = in.nextLong();
        k--;

        for (long i = 0; i < s.length(); i++) {
            if (s.charAt((int)i) != '1') {
                System.out.println(s.charAt((int)i));
                return;
            }

            if (i == k) {
                System.out.println(1);
                return;
            }
        }

        System.out.println(s.charAt(s.length() - 1));
    }
}