import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.nextString();
            long k = in.nextLong();

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

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

    }

    static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        }

        public String nextString() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(nextString());
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.StringTokenizer; StringTokenizer java.util import java.io.IOException; IOException java.io import java.util.InputMismatchException; InputMismatchException java.util import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.nextString();
            long k = in.nextLong();

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

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

    }

    static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        }

        public String nextString() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(nextString());
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out InputReader in = new InputReader(inputStream); in new InputReader(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) TaskC solver = new TaskC(); solver new TaskC() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.nextString();
            long k = in.nextLong();

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

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

    } TaskC public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.nextString();
            long k = in.nextLong();

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

                if (i + 1 == k) {
                    out.println(1);
                    return;
                }
            }
        } solve {
            String s = in.nextString();
            long k = in.nextLong();

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

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

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

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

                if (i + 1 == k) {
                    out.println(1);
                    return;
                }
            } if (s.charAt(i) != '1') {
                    out.println(s.charAt(i));
                    return;
                } s.charAt(i) != '1' s.charAt(i) s.charAt s i '1' {
                    out.println(s.charAt(i));
                    return;
                } out.println(s.charAt(i)) out.println out s.charAt(i) s.charAt s i return; if (i + 1 == k) {
                    out.println(1);
                    return;
                } i + 1 == k i + 1 i 1 k {
                    out.println(1);
                    return;
                } out.println(1) out.println out 1 return; int testNumber testNumber InputReader in in PrintWriter out out static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        }

        public String nextString() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(nextString());
        }

    } InputReader private BufferedReader br; br private StringTokenizer st; st public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        } InputReader {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        } br = new BufferedReader(new InputStreamReader(inputStream)) br new BufferedReader(new InputStreamReader(inputStream)) st = new StringTokenizer("") st new StringTokenizer("") InputStream inputStream inputStream public String nextString() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        } nextString {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        } while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            } !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            } try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                } catch (IOException e) {
                    throw new InputMismatchException();
                } IOException e {
                    throw new InputMismatchException();
                } throw new InputMismatchException(); new InputMismatchException() {
                    st = new StringTokenizer(br.readLine(), " ");
                } st = new StringTokenizer(br.readLine(), " ") st new StringTokenizer(br.readLine(), " ") return st.nextToken(); st.nextToken() st.nextToken st public long nextLong() {
            return Long.parseLong(nextString());
        } nextLong {
            return Long.parseLong(nextString());
        } return Long.parseLong(nextString()); Long.parseLong(nextString()) Long.parseLong Long nextString() nextString public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.nextString();
            long k = in.nextLong();

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

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

    }

    static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        }

        public String nextString() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(nextString());
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.nextString();
            long k = in.nextLong();

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

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

    }

    static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        }

        public String nextString() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(nextString());
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.nextString();
            long k = in.nextLong();

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

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

    }

    static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        }

        public String nextString() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(nextString());
        }

    }
}

