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();
        int notone=-1;
        int notoneindex=-1;
        int[] arr=new int[100];
        for(int i=0;i<S.length();i++){
            arr[i]=S.charAt(i)-'0';
        }
        for(int i=0;i<S.length();i++){
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        }
        if(notone==-1){
            System.out.println("1");
        }else if(K<=notoneindex){
            System.out.println("1");
        }else{
            System.out.println(notone);
        }
    }
} 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();
        int notone=-1;
        int notoneindex=-1;
        int[] arr=new int[100];
        for(int i=0;i<S.length();i++){
            arr[i]=S.charAt(i)-'0';
        }
        for(int i=0;i<S.length();i++){
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        }
        if(notone==-1){
            System.out.println("1");
        }else if(K<=notoneindex){
            System.out.println("1");
        }else{
            System.out.println(notone);
        }
    }
} Main public static void main(String[] args){
        Scanner sc= new Scanner(System.in);
        String S = sc.nextLine();
        long K = sc.nextLong();
        int notone=-1;
        int notoneindex=-1;
        int[] arr=new int[100];
        for(int i=0;i<S.length();i++){
            arr[i]=S.charAt(i)-'0';
        }
        for(int i=0;i<S.length();i++){
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        }
        if(notone==-1){
            System.out.println("1");
        }else if(K<=notoneindex){
            System.out.println("1");
        }else{
            System.out.println(notone);
        }
    } main {
        Scanner sc= new Scanner(System.in);
        String S = sc.nextLine();
        long K = sc.nextLong();
        int notone=-1;
        int notoneindex=-1;
        int[] arr=new int[100];
        for(int i=0;i<S.length();i++){
            arr[i]=S.charAt(i)-'0';
        }
        for(int i=0;i<S.length();i++){
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        }
        if(notone==-1){
            System.out.println("1");
        }else if(K<=notoneindex){
            System.out.println("1");
        }else{
            System.out.println(notone);
        }
    } 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 int notone=-1; notone -1 1 int notoneindex=-1; notoneindex -1 1 int[] arr=new int[100]; arr new int[100] 100 for(int i=0;i<S.length();i++){
            arr[i]=S.charAt(i)-'0';
        } int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
            arr[i]=S.charAt(i)-'0';
        } {
            arr[i]=S.charAt(i)-'0';
        } arr[i]=S.charAt(i)-'0' arr[i] arr i S.charAt(i)-'0' S.charAt(i) S.charAt S i '0' for(int i=0;i<S.length();i++){
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        } int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        } {
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        } if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            } arr[i]!=1 arr[i] arr i 1 {
                notone=arr[i];
                notoneindex=i;
                break;
            } notone=arr[i] notone arr[i] arr i notoneindex=i notoneindex i break; if(notone==-1){
            System.out.println("1");
        }else if(K<=notoneindex){
            System.out.println("1");
        }else{
            System.out.println(notone);
        } notone==-1 notone -1 1 {
            System.out.println("1");
        } System.out.println("1") System.out.println System.out System System.out "1" if(K<=notoneindex){
            System.out.println("1");
        }else{
            System.out.println(notone);
        } K<=notoneindex K notoneindex {
            System.out.println("1");
        } System.out.println("1") System.out.println System.out System System.out "1" {
            System.out.println(notone);
        } System.out.println(notone) System.out.println System.out System System.out notone 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();
        int notone=-1;
        int notoneindex=-1;
        int[] arr=new int[100];
        for(int i=0;i<S.length();i++){
            arr[i]=S.charAt(i)-'0';
        }
        for(int i=0;i<S.length();i++){
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        }
        if(notone==-1){
            System.out.println("1");
        }else if(K<=notoneindex){
            System.out.println("1");
        }else{
            System.out.println(notone);
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc= new Scanner(System.in);
        String S = sc.nextLine();
        long K = sc.nextLong();
        int notone=-1;
        int notoneindex=-1;
        int[] arr=new int[100];
        for(int i=0;i<S.length();i++){
            arr[i]=S.charAt(i)-'0';
        }
        for(int i=0;i<S.length();i++){
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        }
        if(notone==-1){
            System.out.println("1");
        }else if(K<=notoneindex){
            System.out.println("1");
        }else{
            System.out.println(notone);
        }
    }
} 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();
        int notone=-1;
        int notoneindex=-1;
        int[] arr=new int[100];
        for(int i=0;i<S.length();i++){
            arr[i]=S.charAt(i)-'0';
        }
        for(int i=0;i<S.length();i++){
            if(arr[i]!=1){
                notone=arr[i];
                notoneindex=i;
                break;
            }
        }
        if(notone==-1){
            System.out.println("1");
        }else if(K<=notoneindex){
            System.out.println("1");
        }else{
            System.out.println(notone);
        }
    }
}
