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