import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();
        
        char ans = '1';
        long oneIdx = 0;
        for(char str : s) {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        }
        
        if(k <= oneIdx) ans = '1';
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();
        
        char ans = '1';
        long oneIdx = 0;
        for(char str : s) {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        }
        
        if(k <= oneIdx) ans = '1';
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();
        
        char ans = '1';
        long oneIdx = 0;
        for(char str : s) {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        }
        
        if(k <= oneIdx) ans = '1';
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();
        
        char ans = '1';
        long oneIdx = 0;
        for(char str : s) {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        }
        
        if(k <= oneIdx) ans = '1';
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc char ans = '1'; ans '1' long oneIdx = 0; oneIdx 0 for(char str : s) {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        } char str s {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        } {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        } if(str != '1') {
                ans = str;
                break;
            } str != '1' str '1' {
                ans = str;
                break;
            } ans = str ans str break; oneIdx++ oneIdx if(k <= oneIdx) ans = '1'; k <= oneIdx k oneIdx ans = '1' ans '1' 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);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();
        
        char ans = '1';
        long oneIdx = 0;
        for(char str : s) {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        }
        
        if(k <= oneIdx) ans = '1';
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();
        
        char ans = '1';
        long oneIdx = 0;
        for(char str : s) {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        }
        
        if(k <= oneIdx) ans = '1';
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        long k = sc.nextLong();
        
        char ans = '1';
        long oneIdx = 0;
        for(char str : s) {
            if(str != '1') {
                ans = str;
                break;
            }
            oneIdx++;
        }
        
        if(k <= oneIdx) ans = '1';
        System.out.println(ans);
    }
}
