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