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
 */
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);
        ABC106_C solver = new ABC106_C();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC106_C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] charArray = in.nextLine().toCharArray();
            long k = in.nextLong();
            int ans = 1;
            for (int i = 0; i < k; i++) {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            }
            out.print(ans);

        }

    }
}
 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);
        ABC106_C solver = new ABC106_C();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC106_C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] charArray = in.nextLine().toCharArray();
            long k = in.nextLong();
            int ans = 1;
            for (int i = 0; i < k; i++) {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            }
            out.print(ans);

        }

    }
} 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);
        ABC106_C solver = new ABC106_C();
        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);
        ABC106_C solver = new ABC106_C();
        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) ABC106_C solver = new ABC106_C(); solver new ABC106_C() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class ABC106_C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] charArray = in.nextLine().toCharArray();
            long k = in.nextLong();
            int ans = 1;
            for (int i = 0; i < k; i++) {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            }
            out.print(ans);

        }

    } ABC106_C public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] charArray = in.nextLine().toCharArray();
            long k = in.nextLong();
            int ans = 1;
            for (int i = 0; i < k; i++) {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            }
            out.print(ans);

        } solve {
            char[] charArray = in.nextLine().toCharArray();
            long k = in.nextLong();
            int ans = 1;
            for (int i = 0; i < k; i++) {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            }
            out.print(ans);

        } char[] charArray = in.nextLine().toCharArray(); charArray in.nextLine().toCharArray() in.nextLine().toCharArray in.nextLine() in.nextLine in long k = in.nextLong(); k in.nextLong() in.nextLong in int ans = 1; ans 1 for (int i = 0; i < k; i++) {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            } {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            } if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                } charArray[i] != '1' charArray[i] charArray i '1' {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                } ans = Integer.parseInt(String.valueOf(charArray[i])) ans Integer.parseInt(String.valueOf(charArray[i])) Integer.parseInt Integer String.valueOf(charArray[i]) String.valueOf String charArray[i] charArray i break; out.print(ans) out.print out ans 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);
        ABC106_C solver = new ABC106_C();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC106_C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] charArray = in.nextLine().toCharArray();
            long k = in.nextLong();
            int ans = 1;
            for (int i = 0; i < k; i++) {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            }
            out.print(ans);

        }

    }
} 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);
        ABC106_C solver = new ABC106_C();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC106_C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] charArray = in.nextLine().toCharArray();
            long k = in.nextLong();
            int ans = 1;
            for (int i = 0; i < k; i++) {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            }
            out.print(ans);

        }

    }
} 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
 */
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);
        ABC106_C solver = new ABC106_C();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC106_C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] charArray = in.nextLine().toCharArray();
            long k = in.nextLong();
            int ans = 1;
            for (int i = 0; i < k; i++) {
                if (charArray[i] != '1') {
                    ans = Integer.parseInt(String.valueOf(charArray[i]));
                    break;
                }
            }
            out.print(ans);

        }

    }
}

