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