import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = Long.parseLong(sc.next());
        String[] sp = S.split("");
        int[] s = new int[sp.length];
        for(int i=0; i<sp.length; i++) {
            s[i] = Integer.parseInt(sp[i]);
        }
        int ans = 1;
        for(int i=0; i<K; i++) {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = Long.parseLong(sc.next());
        String[] sp = S.split("");
        int[] s = new int[sp.length];
        for(int i=0; i<sp.length; i++) {
            s[i] = Integer.parseInt(sp[i]);
        }
        int ans = 1;
        for(int i=0; i<K; i++) {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = Long.parseLong(sc.next());
        String[] sp = S.split("");
        int[] s = new int[sp.length];
        for(int i=0; i<sp.length; i++) {
            s[i] = Integer.parseInt(sp[i]);
        }
        int ans = 1;
        for(int i=0; i<K; i++) {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = Long.parseLong(sc.next());
        String[] sp = S.split("");
        int[] s = new int[sp.length];
        for(int i=0; i<sp.length; i++) {
            s[i] = Integer.parseInt(sp[i]);
        }
        int ans = 1;
        for(int i=0; i<K; i++) {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                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 = Long.parseLong(sc.next()); K Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc String[] sp = S.split(""); sp S.split("") S.split S "" int[] s = new int[sp.length]; s new int[sp.length] sp.length sp sp.length for(int i=0; i<sp.length; i++) {
            s[i] = Integer.parseInt(sp[i]);
        } int i=0; int i=0; i 0 i<sp.length i sp.length sp sp.length i++ i++ i {
            s[i] = Integer.parseInt(sp[i]);
        } {
            s[i] = Integer.parseInt(sp[i]);
        } s[i] = Integer.parseInt(sp[i]) s[i] s i Integer.parseInt(sp[i]) Integer.parseInt Integer sp[i] sp i int ans = 1; ans 1 for(int i=0; i<K; i++) {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            }
        } int i=0; int i=0; i 0 i<K i K i++ i++ i {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            }
        } {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            }
        } if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            } s[i] == 1 s[i] s i 1 {
            } {
                ans = s[i];
                break;
            } ans = s[i] ans s[i] s i 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) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = Long.parseLong(sc.next());
        String[] sp = S.split("");
        int[] s = new int[sp.length];
        for(int i=0; i<sp.length; i++) {
            s[i] = Integer.parseInt(sp[i]);
        }
        int ans = 1;
        for(int i=0; i<K; i++) {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = Long.parseLong(sc.next());
        String[] sp = S.split("");
        int[] s = new int[sp.length];
        for(int i=0; i<sp.length; i++) {
            s[i] = Integer.parseInt(sp[i]);
        }
        int ans = 1;
        for(int i=0; i<K; i++) {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        long K = Long.parseLong(sc.next());
        String[] sp = S.split("");
        int[] s = new int[sp.length];
        for(int i=0; i<sp.length; i++) {
            s[i] = Integer.parseInt(sp[i]);
        }
        int ans = 1;
        for(int i=0; i<K; i++) {
            if(s[i] == 1) {
            }else {
                ans = s[i];
                break;
            }
        }
        System.out.println(ans);
    }
}