import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {


    public static void main(String[] args) {
        try (CustomReader in = new CustomReader()) {
            new Main().execute(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    public void execute(CustomReader in) throws IOException {
        final String S = in.readLine();
        final long K = Long.parseLong(in.readLine());
        char ans = '1';

        for (int i = 0; i < K && i< S.length(); i++) {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }


    static class CustomReader extends BufferedReader {
        public CustomReader() throws IOException {
            super(new InputStreamReader(System.in));
        }

        public int readLineAsInt() throws IOException {
            return Integer.parseInt(readLine());
        }

        public int[] readLineAsIntArray() throws IOException {
            String[] strArray = this.readLine().split(" ");
            int[] intArray = new int[strArray.length];
            for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            }
            return intArray;
        }

        public int[][] readAsIntMatrix(int rows, int columns) throws IOException {
            int[][] matrix = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            }
            return matrix;
        }

        public char[][] readAsCharMatrix(int rows) throws IOException {
            char[][] matrix = new char[rows][];
            for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            }
            return matrix;
        }

    }

} import java.io.*; io.* java import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {


    public static void main(String[] args) {
        try (CustomReader in = new CustomReader()) {
            new Main().execute(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    public void execute(CustomReader in) throws IOException {
        final String S = in.readLine();
        final long K = Long.parseLong(in.readLine());
        char ans = '1';

        for (int i = 0; i < K && i< S.length(); i++) {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }


    static class CustomReader extends BufferedReader {
        public CustomReader() throws IOException {
            super(new InputStreamReader(System.in));
        }

        public int readLineAsInt() throws IOException {
            return Integer.parseInt(readLine());
        }

        public int[] readLineAsIntArray() throws IOException {
            String[] strArray = this.readLine().split(" ");
            int[] intArray = new int[strArray.length];
            for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            }
            return intArray;
        }

        public int[][] readAsIntMatrix(int rows, int columns) throws IOException {
            int[][] matrix = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            }
            return matrix;
        }

        public char[][] readAsCharMatrix(int rows) throws IOException {
            char[][] matrix = new char[rows][];
            for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            }
            return matrix;
        }

    }

} Main public static void main(String[] args) {
        try (CustomReader in = new CustomReader()) {
            new Main().execute(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    } main {
        try (CustomReader in = new CustomReader()) {
            new Main().execute(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    } try (CustomReader in = new CustomReader()) {
            new Main().execute(in);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            new Main().execute(in);
        } CustomReader in = new CustomReader() CustomReader in = new CustomReader() new CustomReader() new Main().execute(in) new Main().execute new Main() in String[] args args public void execute(CustomReader in) throws IOException {
        final String S = in.readLine();
        final long K = Long.parseLong(in.readLine());
        char ans = '1';

        for (int i = 0; i < K && i< S.length(); i++) {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    } execute {
        final String S = in.readLine();
        final long K = Long.parseLong(in.readLine());
        char ans = '1';

        for (int i = 0; i < K && i< S.length(); i++) {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    } final String S = in.readLine(); S in.readLine() in.readLine in final long K = Long.parseLong(in.readLine()); K Long.parseLong(in.readLine()) Long.parseLong Long in.readLine() in.readLine in char ans = '1'; ans '1' for (int i = 0; i < K && i< S.length(); i++) {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        } int i = 0; int i = 0; i 0 i < K && i< S.length() i < K i K i< S.length() i S.length() S.length S i++ i++ i {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        } {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        } if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
                ans = S.charAt(i);
                break;
            } ans = S.charAt(i) ans S.charAt(i) S.charAt S i break; System.out.println(ans) System.out.println System.out System System.out ans CustomReader in in static class CustomReader extends BufferedReader {
        public CustomReader() throws IOException {
            super(new InputStreamReader(System.in));
        }

        public int readLineAsInt() throws IOException {
            return Integer.parseInt(readLine());
        }

        public int[] readLineAsIntArray() throws IOException {
            String[] strArray = this.readLine().split(" ");
            int[] intArray = new int[strArray.length];
            for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            }
            return intArray;
        }

        public int[][] readAsIntMatrix(int rows, int columns) throws IOException {
            int[][] matrix = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            }
            return matrix;
        }

        public char[][] readAsCharMatrix(int rows) throws IOException {
            char[][] matrix = new char[rows][];
            for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            }
            return matrix;
        }

    } CustomReader public CustomReader() throws IOException {
            super(new InputStreamReader(System.in));
        } CustomReader {
            super(new InputStreamReader(System.in));
        } super(new InputStreamReader(System.in)) super new InputStreamReader(System.in) public int readLineAsInt() throws IOException {
            return Integer.parseInt(readLine());
        } readLineAsInt {
            return Integer.parseInt(readLine());
        } return Integer.parseInt(readLine()); Integer.parseInt(readLine()) Integer.parseInt Integer readLine() readLine public int[] readLineAsIntArray() throws IOException {
            String[] strArray = this.readLine().split(" ");
            int[] intArray = new int[strArray.length];
            for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            }
            return intArray;
        } readLineAsIntArray {
            String[] strArray = this.readLine().split(" ");
            int[] intArray = new int[strArray.length];
            for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            }
            return intArray;
        } String[] strArray = this.readLine().split(" "); strArray this.readLine().split(" ") this.readLine().split this.readLine() this.readLine this " " int[] intArray = new int[strArray.length]; intArray new int[strArray.length] strArray.length strArray strArray.length for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            } int i = 0, n = strArray.length; int i = 0 i 0 n = strArray.length; n strArray.length strArray strArray.length i < n i n i++ i++ i {
                intArray[i] = Integer.parseInt(strArray[i]);
            } {
                intArray[i] = Integer.parseInt(strArray[i]);
            } intArray[i] = Integer.parseInt(strArray[i]) intArray[i] intArray i Integer.parseInt(strArray[i]) Integer.parseInt Integer strArray[i] strArray i return intArray; intArray public int[][] readAsIntMatrix(int rows, int columns) throws IOException {
            int[][] matrix = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            }
            return matrix;
        } readAsIntMatrix {
            int[][] matrix = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            }
            return matrix;
        } int[][] matrix = new int[rows][columns]; matrix new int[rows][columns] rows columns for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            } int i = 0; int i = 0; i 0 i < rows i rows i++ i++ i {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            } {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            } String[] r = this.readLine().split(" "); r this.readLine().split(" ") this.readLine().split this.readLine() this.readLine this " " for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                } int j = 0; int j = 0; j 0 j < columns j columns j++ j++ j {
                    matrix[i][j] = Integer.parseInt(r[j]);
                } {
                    matrix[i][j] = Integer.parseInt(r[j]);
                } matrix[i][j] = Integer.parseInt(r[j]) matrix[i][j] matrix[i] matrix i j Integer.parseInt(r[j]) Integer.parseInt Integer r[j] r j return matrix; matrix int rows rows int columns columns public char[][] readAsCharMatrix(int rows) throws IOException {
            char[][] matrix = new char[rows][];
            for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            }
            return matrix;
        } readAsCharMatrix {
            char[][] matrix = new char[rows][];
            for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            }
            return matrix;
        } char[][] matrix = new char[rows][]; matrix new char[rows][] rows for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            } int i = 0; int i = 0; i 0 i < rows i rows i++ i++ i {
                matrix[i] = this.readLine().toCharArray();
            } {
                matrix[i] = this.readLine().toCharArray();
            } matrix[i] = this.readLine().toCharArray() matrix[i] matrix i this.readLine().toCharArray() this.readLine().toCharArray this.readLine() this.readLine this return matrix; matrix int rows rows BufferedReader public class Main {


    public static void main(String[] args) {
        try (CustomReader in = new CustomReader()) {
            new Main().execute(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    public void execute(CustomReader in) throws IOException {
        final String S = in.readLine();
        final long K = Long.parseLong(in.readLine());
        char ans = '1';

        for (int i = 0; i < K && i< S.length(); i++) {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }


    static class CustomReader extends BufferedReader {
        public CustomReader() throws IOException {
            super(new InputStreamReader(System.in));
        }

        public int readLineAsInt() throws IOException {
            return Integer.parseInt(readLine());
        }

        public int[] readLineAsIntArray() throws IOException {
            String[] strArray = this.readLine().split(" ");
            int[] intArray = new int[strArray.length];
            for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            }
            return intArray;
        }

        public int[][] readAsIntMatrix(int rows, int columns) throws IOException {
            int[][] matrix = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            }
            return matrix;
        }

        public char[][] readAsCharMatrix(int rows) throws IOException {
            char[][] matrix = new char[rows][];
            for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            }
            return matrix;
        }

    }

} public class Main {


    public static void main(String[] args) {
        try (CustomReader in = new CustomReader()) {
            new Main().execute(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    public void execute(CustomReader in) throws IOException {
        final String S = in.readLine();
        final long K = Long.parseLong(in.readLine());
        char ans = '1';

        for (int i = 0; i < K && i< S.length(); i++) {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }


    static class CustomReader extends BufferedReader {
        public CustomReader() throws IOException {
            super(new InputStreamReader(System.in));
        }

        public int readLineAsInt() throws IOException {
            return Integer.parseInt(readLine());
        }

        public int[] readLineAsIntArray() throws IOException {
            String[] strArray = this.readLine().split(" ");
            int[] intArray = new int[strArray.length];
            for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            }
            return intArray;
        }

        public int[][] readAsIntMatrix(int rows, int columns) throws IOException {
            int[][] matrix = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            }
            return matrix;
        }

        public char[][] readAsCharMatrix(int rows) throws IOException {
            char[][] matrix = new char[rows][];
            for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            }
            return matrix;
        }

    }

} Main
import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {


    public static void main(String[] args) {
        try (CustomReader in = new CustomReader()) {
            new Main().execute(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    public void execute(CustomReader in) throws IOException {
        final String S = in.readLine();
        final long K = Long.parseLong(in.readLine());
        char ans = '1';

        for (int i = 0; i < K && i< S.length(); i++) {
            if(S.charAt(i) != '1'){
                ans = S.charAt(i);
                break;
            }
        }
        System.out.println(ans);
    }


    static class CustomReader extends BufferedReader {
        public CustomReader() throws IOException {
            super(new InputStreamReader(System.in));
        }

        public int readLineAsInt() throws IOException {
            return Integer.parseInt(readLine());
        }

        public int[] readLineAsIntArray() throws IOException {
            String[] strArray = this.readLine().split(" ");
            int[] intArray = new int[strArray.length];
            for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            }
            return intArray;
        }

        public int[][] readAsIntMatrix(int rows, int columns) throws IOException {
            int[][] matrix = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            }
            return matrix;
        }

        public char[][] readAsCharMatrix(int rows) throws IOException {
            char[][] matrix = new char[rows][];
            for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            }
            return matrix;
        }

    }

}