import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        for(int i = 0; i < s.length(); i++){
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        }
        System.out.println(1);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        for(int i = 0; i < s.length(); i++){
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        }
        System.out.println(1);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        for(int i = 0; i < s.length(); i++){
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        }
        System.out.println(1);
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        for(int i = 0; i < s.length(); i++){
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        }
        System.out.println(1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc for(int i = 0; i < s.length(); i++){
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        } {
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        } char c = s.charAt(i); c s.charAt(i) s.charAt s i if(c != '1'){
                System.out.println(c);
                return;
            } c != '1' c '1' {
                System.out.println(c);
                return;
            } System.out.println(c) System.out.println System.out System System.out c return; if((long)i+1 == k){
                break;
            } (long)i+1 == k (long)i+1 (long)i 1 k {
                break;
            } break; System.out.println(1) System.out.println System.out System System.out 1 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        for(int i = 0; i < s.length(); i++){
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        }
        System.out.println(1);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        for(int i = 0; i < s.length(); i++){
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        }
        System.out.println(1);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        for(int i = 0; i < s.length(); i++){
            char c = s.charAt(i);
            if(c != '1'){
                System.out.println(c);
                return;
            }
            if((long)i+1 == k){
                break;
            }
        }
        System.out.println(1);
    }
}
