import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();

        for (char c : s) {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        }

        System.out.println(1);

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();

        for (char c : s) {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        }

        System.out.println(1);

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();

        for (char c : s) {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        }

        System.out.println(1);

    } main {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();

        for (char c : s) {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        }

        System.out.println(1);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc for (char c : s) {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        } char c s {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        } {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        } int num = Character.getNumericValue(c); num Character.getNumericValue(c) Character.getNumericValue Character c if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            } num == 1 && --k == 0 num == 1 num 1 --k == 0 --k k 0 {
                System.out.println(1);
                return;
            } System.out.println(1) System.out.println System.out System System.out 1 return; if (num != 1) {
                System.out.println(num);
                return;
            } num != 1 num 1 {
                System.out.println(num);
                return;
            } System.out.println(num) System.out.println System.out System System.out num 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) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();

        for (char c : s) {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        }

        System.out.println(1);

    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();

        for (char c : s) {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        }

        System.out.println(1);

    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();

        for (char c : s) {
            int num = Character.getNumericValue(c);

            if (num == 1 && --k == 0) {
                System.out.println(1);
                return;
            }

            if (num != 1) {
                System.out.println(num);
                return;
            }
        }

        System.out.println(1);

    }
}