import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] initial = sc.nextLine().split("");
    long K = sc.nextLong();
    long index = 1;
    String answer = "1";
    for (String num: initial) {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    }  
    System.out.println(answer);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] initial = sc.nextLine().split("");
    long K = sc.nextLong();
    long index = 1;
    String answer = "1";
    for (String num: initial) {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    }  
    System.out.println(answer);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] initial = sc.nextLine().split("");
    long K = sc.nextLong();
    long index = 1;
    String answer = "1";
    for (String num: initial) {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    }  
    System.out.println(answer);
  } main {
    Scanner sc = new Scanner(System.in);
    String[] initial = sc.nextLine().split("");
    long K = sc.nextLong();
    long index = 1;
    String answer = "1";
    for (String num: initial) {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    }  
    System.out.println(answer);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] initial = sc.nextLine().split(""); initial sc.nextLine().split("") sc.nextLine().split sc.nextLine() sc.nextLine sc "" long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc long index = 1; index 1 String answer = "1"; answer "1" for (String num: initial) {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    } String num initial {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    } {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    } if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      } num.equals("1") && index < K num.equals("1") num.equals num "1" index < K index K {
        index++; 
      } index++ index {
        answer = num;
        break;
      } answer = num answer num break; System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] initial = sc.nextLine().split("");
    long K = sc.nextLong();
    long index = 1;
    String answer = "1";
    for (String num: initial) {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    }  
    System.out.println(answer);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] initial = sc.nextLine().split("");
    long K = sc.nextLong();
    long index = 1;
    String answer = "1";
    for (String num: initial) {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    }  
    System.out.println(answer);
  }
} Main
import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] initial = sc.nextLine().split("");
    long K = sc.nextLong();
    long index = 1;
    String answer = "1";
    for (String num: initial) {
      if (num.equals("1") && index < K) {
        index++; 
      } else {
        answer = num;
        break;
      }
    }  
    System.out.println(answer);
  }
}