import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class CToInfinity {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] s = in.next().toCharArray();
            long k = in.nextLong() - 1;
            int i = 0;
            for (; k > 0; i++) {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            }
            out.println(s[i]);
        }

    }
}
 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.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CToInfinity solver = new CToInfinity();
        solver.solve(1, in, out);
        out.close();
    }

    static class CToInfinity {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] s = in.next().toCharArray();
            long k = in.nextLong() - 1;
            int i = 0;
            for (; k > 0; i++) {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            }
            out.println(s[i]);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CToInfinity solver = new CToInfinity();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CToInfinity solver = new CToInfinity();
        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 Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) CToInfinity solver = new CToInfinity(); solver new CToInfinity() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class CToInfinity {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] s = in.next().toCharArray();
            long k = in.nextLong() - 1;
            int i = 0;
            for (; k > 0; i++) {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            }
            out.println(s[i]);
        }

    } CToInfinity public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] s = in.next().toCharArray();
            long k = in.nextLong() - 1;
            int i = 0;
            for (; k > 0; i++) {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            }
            out.println(s[i]);
        } solve {
            char[] s = in.next().toCharArray();
            long k = in.nextLong() - 1;
            int i = 0;
            for (; k > 0; i++) {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            }
            out.println(s[i]);
        } char[] s = in.next().toCharArray(); s in.next().toCharArray() in.next().toCharArray in.next() in.next in long k = in.nextLong() - 1; k in.nextLong() - 1 in.nextLong() in.nextLong in 1 int i = 0; i 0 for (; k > 0; i++) {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            } ; k > 0 k 0 i++ i++ i {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            } {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            } if (s[i] == '1') {
                    k--;
                } else {
                    break;
                } s[i] == '1' s[i] s i '1' {
                    k--;
                } k-- k {
                    break;
                } break; out.println(s[i]) out.println out s[i] s i int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CToInfinity solver = new CToInfinity();
        solver.solve(1, in, out);
        out.close();
    }

    static class CToInfinity {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] s = in.next().toCharArray();
            long k = in.nextLong() - 1;
            int i = 0;
            for (; k > 0; i++) {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            }
            out.println(s[i]);
        }

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

    static class CToInfinity {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] s = in.next().toCharArray();
            long k = in.nextLong() - 1;
            int i = 0;
            for (; k > 0; i++) {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            }
            out.println(s[i]);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class CToInfinity {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] s = in.next().toCharArray();
            long k = in.nextLong() - 1;
            int i = 0;
            for (; k > 0; i++) {
                if (s[i] == '1') {
                    k--;
                } else {
                    break;
                }
            }
            out.println(s[i]);
        }

    }
}

