import java.math.BigDecimal;
import java.util.Scanner;

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

            char[] s = sc.next().toCharArray();
            BigDecimal decimal = sc.nextBigDecimal();

            long i = 0L;
            for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            }
            // if(s.length == i && k > i) {
            // System.out.println();
            // return;
            // }

            if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            }
            System.out.println(1);
        }
    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {

            char[] s = sc.next().toCharArray();
            BigDecimal decimal = sc.nextBigDecimal();

            long i = 0L;
            for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            }
            // if(s.length == i && k > i) {
            // System.out.println();
            // return;
            // }

            if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            }
            System.out.println(1);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {

            char[] s = sc.next().toCharArray();
            BigDecimal decimal = sc.nextBigDecimal();

            long i = 0L;
            for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            }
            // if(s.length == i && k > i) {
            // System.out.println();
            // return;
            // }

            if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            }
            System.out.println(1);
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {

            char[] s = sc.next().toCharArray();
            BigDecimal decimal = sc.nextBigDecimal();

            long i = 0L;
            for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            }
            // if(s.length == i && k > i) {
            // System.out.println();
            // return;
            // }

            if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            }
            System.out.println(1);
        }
    } try (Scanner sc = new Scanner(System.in)) {

            char[] s = sc.next().toCharArray();
            BigDecimal decimal = sc.nextBigDecimal();

            long i = 0L;
            for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            }
            // if(s.length == i && k > i) {
            // System.out.println();
            // return;
            // }

            if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            }
            System.out.println(1);
        } {

            char[] s = sc.next().toCharArray();
            BigDecimal decimal = sc.nextBigDecimal();

            long i = 0L;
            for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            }
            // if(s.length == i && k > i) {
            // System.out.println();
            // return;
            // }

            if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            }
            System.out.println(1);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc BigDecimal decimal = sc.nextBigDecimal(); decimal sc.nextBigDecimal() sc.nextBigDecimal sc long i = 0L; i 0L for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            } ; i < s.length i s.length s s.length i++ i++ i {
                if (s[(int) i] != '1') {
                    break;
                }
            } {
                if (s[(int) i] != '1') {
                    break;
                }
            } if (s[(int) i] != '1') {
                    break;
                } s[(int) i] != '1' s[(int) i] s (int) i '1' {
                    break;
                } break; if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            } decimal.compareTo(BigDecimal.valueOf(i)) > 0 decimal.compareTo(BigDecimal.valueOf(i)) decimal.compareTo decimal BigDecimal.valueOf(i) BigDecimal.valueOf BigDecimal i 0 {
                System.out.println(s[(int) i]);
                return;
            } System.out.println(s[(int) i]) System.out.println System.out System System.out s[(int) i] s (int) i return; System.out.println(1) System.out.println System.out System System.out 1 String[] args args public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {

            char[] s = sc.next().toCharArray();
            BigDecimal decimal = sc.nextBigDecimal();

            long i = 0L;
            for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            }
            // if(s.length == i && k > i) {
            // System.out.println();
            // return;
            // }

            if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            }
            System.out.println(1);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {

            char[] s = sc.next().toCharArray();
            BigDecimal decimal = sc.nextBigDecimal();

            long i = 0L;
            for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            }
            // if(s.length == i && k > i) {
            // System.out.println();
            // return;
            // }

            if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            }
            System.out.println(1);
        }
    }
} Main
import java.math.BigDecimal;
import java.util.Scanner;

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

            char[] s = sc.next().toCharArray();
            BigDecimal decimal = sc.nextBigDecimal();

            long i = 0L;
            for (; i < s.length; i++) {
                if (s[(int) i] != '1') {
                    break;
                }
            }
            // if(s.length == i && k > i) {
            // System.out.println();
            // return;
            // }

            if (decimal.compareTo(BigDecimal.valueOf(i)) > 0) {
                System.out.println(s[(int) i]);
                return;
            }
            System.out.println(1);
        }
    }
}
