import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        if(s.charAt(0) != '1'){
            System.out.println(s.charAt(0));
            return;
        }
        int cnt = 1;
        for(int i = 1;i < s.length();i++){
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        }
        if(k <= cnt){
            System.out.println(1);
            return;
        }
        System.out.println(s.charAt(cnt));
    }
} import java.util.Scanner; Scanner java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        if(s.charAt(0) != '1'){
            System.out.println(s.charAt(0));
            return;
        }
        int cnt = 1;
        for(int i = 1;i < s.length();i++){
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        }
        if(k <= cnt){
            System.out.println(1);
            return;
        }
        System.out.println(s.charAt(cnt));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        if(s.charAt(0) != '1'){
            System.out.println(s.charAt(0));
            return;
        }
        int cnt = 1;
        for(int i = 1;i < s.length();i++){
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        }
        if(k <= cnt){
            System.out.println(1);
            return;
        }
        System.out.println(s.charAt(cnt));
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        if(s.charAt(0) != '1'){
            System.out.println(s.charAt(0));
            return;
        }
        int cnt = 1;
        for(int i = 1;i < s.length();i++){
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        }
        if(k <= cnt){
            System.out.println(1);
            return;
        }
        System.out.println(s.charAt(cnt));
    } 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(s.charAt(0) != '1'){
            System.out.println(s.charAt(0));
            return;
        } s.charAt(0) != '1' s.charAt(0) s.charAt s 0 '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 cnt = 1; cnt 1 for(int i = 1;i < s.length();i++){
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        } int i = 1; int i = 1; i 1 i < s.length() i s.length() s.length s i++ i++ i {
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        } {
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        } if(s.charAt(i) == '1'){
                cnt++;
                continue;
            } s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
                cnt++;
                continue;
            } cnt++ cnt continue; break; if(k <= cnt){
            System.out.println(1);
            return;
        } k <= cnt k cnt {
            System.out.println(1);
            return;
        } System.out.println(1) System.out.println System.out System System.out 1 return; System.out.println(s.charAt(cnt)) System.out.println System.out System System.out s.charAt(cnt) s.charAt s cnt String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        if(s.charAt(0) != '1'){
            System.out.println(s.charAt(0));
            return;
        }
        int cnt = 1;
        for(int i = 1;i < s.length();i++){
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        }
        if(k <= cnt){
            System.out.println(1);
            return;
        }
        System.out.println(s.charAt(cnt));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        if(s.charAt(0) != '1'){
            System.out.println(s.charAt(0));
            return;
        }
        int cnt = 1;
        for(int i = 1;i < s.length();i++){
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        }
        if(k <= cnt){
            System.out.println(1);
            return;
        }
        System.out.println(s.charAt(cnt));
    }
} Main
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        if(s.charAt(0) != '1'){
            System.out.println(s.charAt(0));
            return;
        }
        int cnt = 1;
        for(int i = 1;i < s.length();i++){
            if(s.charAt(i) == '1'){
                cnt++;
                continue;
            }
            break;
        }
        if(k <= cnt){
            System.out.println(1);
            return;
        }
        System.out.println(s.charAt(cnt));
    }
}
