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();
        if(k == 1) {
            System.out.println(s.charAt(0));
            return;
        }
            
        int idx = 0;
        while(idx < s.length() && idx < k-1) {
            if(s.charAt(idx) != '1')
                break;
            idx++;
        }
        System.out.println(idx == s.length() ? 1 : s.charAt(idx));
    }
} 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();
        if(k == 1) {
            System.out.println(s.charAt(0));
            return;
        }
            
        int idx = 0;
        while(idx < s.length() && idx < k-1) {
            if(s.charAt(idx) != '1')
                break;
            idx++;
        }
        System.out.println(idx == s.length() ? 1 : s.charAt(idx));
    }
} Main public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        if(k == 1) {
            System.out.println(s.charAt(0));
            return;
        }
            
        int idx = 0;
        while(idx < s.length() && idx < k-1) {
            if(s.charAt(idx) != '1')
                break;
            idx++;
        }
        System.out.println(idx == s.length() ? 1 : s.charAt(idx));
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        if(k == 1) {
            System.out.println(s.charAt(0));
            return;
        }
            
        int idx = 0;
        while(idx < s.length() && idx < k-1) {
            if(s.charAt(idx) != '1')
                break;
            idx++;
        }
        System.out.println(idx == s.length() ? 1 : s.charAt(idx));
    } 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 if(k == 1) {
            System.out.println(s.charAt(0));
            return;
        } k == 1 k 1 {
            System.out.println(s.charAt(0));
            return;
        } System.out.println(s.charAt(0)) System.out.println System.out System System.out s.charAt(0) s.charAt s 0 return; int idx = 0; idx 0 while(idx < s.length() && idx < k-1) {
            if(s.charAt(idx) != '1')
                break;
            idx++;
        } idx < s.length() && idx < k-1 idx < s.length() idx s.length() s.length s idx < k-1 idx k-1 k 1 {
            if(s.charAt(idx) != '1')
                break;
            idx++;
        } if(s.charAt(idx) != '1')
                break; s.charAt(idx) != '1' s.charAt(idx) s.charAt s idx '1' break; idx++ idx System.out.println(idx == s.length() ? 1 : s.charAt(idx)) System.out.println System.out System System.out idx == s.length() ? 1 : s.charAt(idx) idx == s.length() idx s.length() s.length s 1 s.charAt(idx) s.charAt s idx 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();
        if(k == 1) {
            System.out.println(s.charAt(0));
            return;
        }
            
        int idx = 0;
        while(idx < s.length() && idx < k-1) {
            if(s.charAt(idx) != '1')
                break;
            idx++;
        }
        System.out.println(idx == s.length() ? 1 : s.charAt(idx));
    }
} 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();
        if(k == 1) {
            System.out.println(s.charAt(0));
            return;
        }
            
        int idx = 0;
        while(idx < s.length() && idx < k-1) {
            if(s.charAt(idx) != '1')
                break;
            idx++;
        }
        System.out.println(idx == s.length() ? 1 : s.charAt(idx));
    }
} 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();
        if(k == 1) {
            System.out.println(s.charAt(0));
            return;
        }
            
        int idx = 0;
        while(idx < s.length() && idx < k-1) {
            if(s.charAt(idx) != '1')
                break;
            idx++;
        }
        System.out.println(idx == s.length() ? 1 : s.charAt(idx));
    }
}
