import java.util.*;

public class Main {
    public void main(Scanner sc) {
        char s[] = sc.next().toCharArray();
        long k = sc.nextLong();

        if (s[0] != '1') {
            System.out.println(s[0]);
            return;
        }

        for (int i = 0; i < s.length; i++) {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        }
    }

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

        if (s[0] != '1') {
            System.out.println(s[0]);
            return;
        }

        for (int i = 0; i < s.length; i++) {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        }
    }

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

        if (s[0] != '1') {
            System.out.println(s[0]);
            return;
        }

        for (int i = 0; i < s.length; i++) {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        }
    } main {
        char s[] = sc.next().toCharArray();
        long k = sc.nextLong();

        if (s[0] != '1') {
            System.out.println(s[0]);
            return;
        }

        for (int i = 0; i < s.length; i++) {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        }
    } 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 if (s[0] != '1') {
            System.out.println(s[0]);
            return;
        } s[0] != '1' s[0] s 0 '1' {
            System.out.println(s[0]);
            return;
        } System.out.println(s[0]) System.out.println System.out System System.out s[0] s 0 return; for (int i = 0; i < s.length; i++) {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        } {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        } if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            } s[i] != '1' s[i] s i '1' {
                System.out.println(s[i]);
                break;
            } System.out.println(s[i]) System.out.println System.out System System.out s[i] s i break; if (i + 1 == k) {
                System.out.println(1);
                break;
            } i + 1 == k i + 1 i 1 k {
                System.out.println(1);
                break;
            } System.out.println(1) System.out.println System.out System System.out 1 break; Scanner sc sc public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) new Main().main(sc) new Main().main new Main() sc sc.close() sc.close sc String[] args args public class Main {
    public void main(Scanner sc) {
        char s[] = sc.next().toCharArray();
        long k = sc.nextLong();

        if (s[0] != '1') {
            System.out.println(s[0]);
            return;
        }

        for (int i = 0; i < s.length; i++) {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        }
    }

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

        if (s[0] != '1') {
            System.out.println(s[0]);
            return;
        }

        for (int i = 0; i < s.length; i++) {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
} Main
import java.util.*;

public class Main {
    public void main(Scanner sc) {
        char s[] = sc.next().toCharArray();
        long k = sc.nextLong();

        if (s[0] != '1') {
            System.out.println(s[0]);
            return;
        }

        for (int i = 0; i < s.length; i++) {
            if (s[i] != '1') {
                System.out.println(s[i]);
                break;
            }
            if (i + 1 == k) {
                System.out.println(1);
                break;
            }
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
}
