import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        long o = 0;
        int a[] = new int[s.length()];
        for(int i = 0; i < s.length(); i++){
            a[i] = Character.getNumericValue(s.charAt(i));
        }
        for(int i = 0; i < s.length(); i++){
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        }
        if (o >= k) {
            System.out.println(1);
        }else{
            System.out.println(s.charAt((int)o));
        }
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        long o = 0;
        int a[] = new int[s.length()];
        for(int i = 0; i < s.length(); i++){
            a[i] = Character.getNumericValue(s.charAt(i));
        }
        for(int i = 0; i < s.length(); i++){
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        }
        if (o >= k) {
            System.out.println(1);
        }else{
            System.out.println(s.charAt((int)o));
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        long o = 0;
        int a[] = new int[s.length()];
        for(int i = 0; i < s.length(); i++){
            a[i] = Character.getNumericValue(s.charAt(i));
        }
        for(int i = 0; i < s.length(); i++){
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        }
        if (o >= k) {
            System.out.println(1);
        }else{
            System.out.println(s.charAt((int)o));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        long o = 0;
        int a[] = new int[s.length()];
        for(int i = 0; i < s.length(); i++){
            a[i] = Character.getNumericValue(s.charAt(i));
        }
        for(int i = 0; i < s.length(); i++){
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        }
        if (o >= k) {
            System.out.println(1);
        }else{
            System.out.println(s.charAt((int)o));
        }
    } 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 long o = 0; o 0 int a[] = new int[s.length()]; a new int[s.length()] s.length() s.length s for(int i = 0; i < s.length(); i++){
            a[i] = Character.getNumericValue(s.charAt(i));
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            a[i] = Character.getNumericValue(s.charAt(i));
        } {
            a[i] = Character.getNumericValue(s.charAt(i));
        } a[i] = Character.getNumericValue(s.charAt(i)) a[i] a i Character.getNumericValue(s.charAt(i)) Character.getNumericValue Character s.charAt(i) s.charAt s i for(int i = 0; i < s.length(); i++){
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        } {
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        } if (a[i] == 1) {
                o++;
            }else{
                break;
            } a[i] == 1 a[i] a i 1 {
                o++;
            } o++ o {
                break;
            } break; if (o >= k) {
            System.out.println(1);
        }else{
            System.out.println(s.charAt((int)o));
        } o >= k o k {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 {
            System.out.println(s.charAt((int)o));
        } System.out.println(s.charAt((int)o)) System.out.println System.out System System.out s.charAt((int)o) s.charAt s (int)o 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();
        long o = 0;
        int a[] = new int[s.length()];
        for(int i = 0; i < s.length(); i++){
            a[i] = Character.getNumericValue(s.charAt(i));
        }
        for(int i = 0; i < s.length(); i++){
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        }
        if (o >= k) {
            System.out.println(1);
        }else{
            System.out.println(s.charAt((int)o));
        }
    }
} public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        long o = 0;
        int a[] = new int[s.length()];
        for(int i = 0; i < s.length(); i++){
            a[i] = Character.getNumericValue(s.charAt(i));
        }
        for(int i = 0; i < s.length(); i++){
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        }
        if (o >= k) {
            System.out.println(1);
        }else{
            System.out.println(s.charAt((int)o));
        }
    }
} Main
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long k = sc.nextLong();
        long o = 0;
        int a[] = new int[s.length()];
        for(int i = 0; i < s.length(); i++){
            a[i] = Character.getNumericValue(s.charAt(i));
        }
        for(int i = 0; i < s.length(); i++){
            if (a[i] == 1) {
                o++;
            }else{
                break;
            }
        }
        if (o >= k) {
            System.out.println(1);
        }else{
            System.out.println(s.charAt((int)o));
        }
    }
}