import java.util.*;
import java.lang.*;
class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = scan.nextLong();
        char tmp = '1';
        int index = S.length();
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                tmp = S.charAt(i);
                index = i+1;
                break;
            }
        }
        if(index > K)
            System.out.println(1);
        else
            System.out.println(tmp);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = scan.nextLong();
        char tmp = '1';
        int index = S.length();
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                tmp = S.charAt(i);
                index = i+1;
                break;
            }
        }
        if(index > K)
            System.out.println(1);
        else
            System.out.println(tmp);
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = scan.nextLong();
        char tmp = '1';
        int index = S.length();
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                tmp = S.charAt(i);
                index = i+1;
                break;
            }
        }
        if(index > K)
            System.out.println(1);
        else
            System.out.println(tmp);
    } main {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = scan.nextLong();
        char tmp = '1';
        int index = S.length();
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                tmp = S.charAt(i);
                index = i+1;
                break;
            }
        }
        if(index > K)
            System.out.println(1);
        else
            System.out.println(tmp);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan long K = scan.nextLong(); K scan.nextLong() scan.nextLong scan char tmp = '1'; tmp '1' int index = S.length(); index S.length() S.length S for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                tmp = S.charAt(i);
                index = i+1;
                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'){
                tmp = S.charAt(i);
                index = i+1;
                break;
            }
        } {
            if(S.charAt(i) != '1'){
                tmp = S.charAt(i);
                index = i+1;
                break;
            }
        } if(S.charAt(i) != '1'){
                tmp = S.charAt(i);
                index = i+1;
                break;
            } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
                tmp = S.charAt(i);
                index = i+1;
                break;
            } tmp = S.charAt(i) tmp S.charAt(i) S.charAt S i index = i+1 index i+1 i 1 break; if(index > K)
            System.out.println(1);
        else
            System.out.println(tmp); index > K index K System.out.println(1) System.out.println System.out System System.out 1 System.out.println(tmp) System.out.println System.out System System.out tmp String[] args args
import java.util.*;
import java.lang.*;
class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        long K = scan.nextLong();
        char tmp = '1';
        int index = S.length();
        for(int i = 0; i < S.length(); i++){
            if(S.charAt(i) != '1'){
                tmp = S.charAt(i);
                index = i+1;
                break;
            }
        }
        if(index > K)
            System.out.println(1);
        else
            System.out.println(tmp);
    }
}
