import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int n = S.length();
        if(n == 1){
            System.out.println(S);
        }else{
             String[] a = new String[n];
            a = S.split("");
            int[] b = new int[n];
            for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            }
            int count = 0;
            int ans = 0;
            for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            }
            System.out.println(ans);
        }
       
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int n = S.length();
        if(n == 1){
            System.out.println(S);
        }else{
             String[] a = new String[n];
            a = S.split("");
            int[] b = new int[n];
            for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            }
            int count = 0;
            int ans = 0;
            for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            }
            System.out.println(ans);
        }
       
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int n = S.length();
        if(n == 1){
            System.out.println(S);
        }else{
             String[] a = new String[n];
            a = S.split("");
            int[] b = new int[n];
            for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            }
            int count = 0;
            int ans = 0;
            for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            }
            System.out.println(ans);
        }
       
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int n = S.length();
        if(n == 1){
            System.out.println(S);
        }else{
             String[] a = new String[n];
            a = S.split("");
            int[] b = new int[n];
            for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            }
            int count = 0;
            int ans = 0;
            for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            }
            System.out.println(ans);
        }
       
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc int n = S.length(); n S.length() S.length S if(n == 1){
            System.out.println(S);
        }else{
             String[] a = new String[n];
            a = S.split("");
            int[] b = new int[n];
            for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            }
            int count = 0;
            int ans = 0;
            for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            }
            System.out.println(ans);
        } n == 1 n 1 {
            System.out.println(S);
        } System.out.println(S) System.out.println System.out System System.out S {
             String[] a = new String[n];
            a = S.split("");
            int[] b = new int[n];
            for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            }
            int count = 0;
            int ans = 0;
            for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            }
            System.out.println(ans);
        } String[] a = new String[n]; a new String[n] n a = S.split("") a S.split("") S.split S "" int[] b = new int[n]; b new int[n] n for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                b[i] = Integer.parseInt(a[i]);
            } {
                b[i] = Integer.parseInt(a[i]);
            } b[i] = Integer.parseInt(a[i]) b[i] b i Integer.parseInt(a[i]) Integer.parseInt Integer a[i] a i int count = 0; count 0 int ans = 0; ans 0 for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            } {
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            } if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                } b[i] != 1 b[i] b i 1 {
                    ans = b[i];
                    break;
                } ans = b[i] ans b[i] b i break; {
                    count ++;
                } count ++ count if(count >= K){
                    ans = 1;
                    break;
                } count >= K count K {
                    ans = 1;
                    break;
                } ans = 1 ans 1 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int n = S.length();
        if(n == 1){
            System.out.println(S);
        }else{
             String[] a = new String[n];
            a = S.split("");
            int[] b = new int[n];
            for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            }
            int count = 0;
            int ans = 0;
            for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            }
            System.out.println(ans);
        }
       
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int n = S.length();
        if(n == 1){
            System.out.println(S);
        }else{
             String[] a = new String[n];
            a = S.split("");
            int[] b = new int[n];
            for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            }
            int count = 0;
            int ans = 0;
            for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            }
            System.out.println(ans);
        }
       
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = sc.nextLong();
        int n = S.length();
        if(n == 1){
            System.out.println(S);
        }else{
             String[] a = new String[n];
            a = S.split("");
            int[] b = new int[n];
            for(int i = 0; i < n; i++){
                b[i] = Integer.parseInt(a[i]);
            }
            int count = 0;
            int ans = 0;
            for(int i = 0; i < K; i++){
                if(b[i] != 1){
                    ans = b[i];
                    break;
                }else{
                    count ++;
                }
                if(count >= K){
                    ans = 1;
                    break;
                }
            }
            System.out.println(ans);
        }
       
    }
}
