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