import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        Long K = sc.nextLong();
        sc.close();
        int x =0;
        int idx = -1;
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        }
        if(idx < 0 || idx >= K)System.out.println(1);
        else System.out.println(x);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        Long K = sc.nextLong();
        sc.close();
        int x =0;
        int idx = -1;
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        }
        if(idx < 0 || idx >= K)System.out.println(1);
        else System.out.println(x);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        Long K = sc.nextLong();
        sc.close();
        int x =0;
        int idx = -1;
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        }
        if(idx < 0 || idx >= K)System.out.println(1);
        else System.out.println(x);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        Long K = sc.nextLong();
        sc.close();
        int x =0;
        int idx = -1;
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        }
        if(idx < 0 || idx >= K)System.out.println(1);
        else System.out.println(x);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc Long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc sc.close() sc.close sc int x =0; x 0 int idx = -1; idx -1 1 for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        } {
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        } if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            } x = Integer.parseInt(String.valueOf(S.charAt(i))) x Integer.parseInt(String.valueOf(S.charAt(i))) Integer.parseInt Integer String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i idx = i idx i break; if(idx < 0 || idx >= K)System.out.println(1);
        else System.out.println(x); idx < 0 || idx >= K idx < 0 idx 0 idx >= K idx K System.out.println(1) System.out.println System.out System System.out 1 System.out.println(x) System.out.println System.out System System.out x String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        Long K = sc.nextLong();
        sc.close();
        int x =0;
        int idx = -1;
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        }
        if(idx < 0 || idx >= K)System.out.println(1);
        else System.out.println(x);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        Long K = sc.nextLong();
        sc.close();
        int x =0;
        int idx = -1;
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        }
        if(idx < 0 || idx >= K)System.out.println(1);
        else System.out.println(x);
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        Long K = sc.nextLong();
        sc.close();
        int x =0;
        int idx = -1;
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                x = Integer.parseInt(String.valueOf(S.charAt(i)));
                idx = i;
                break;
            }
        }
        if(idx < 0 || idx >= K)System.out.println(1);
        else System.out.println(x);
    }

}
