import java.util.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] S = sc.nextLine().split("");
    long K = sc.nextLong();
    String ret = "1";
    for (int i = 0; i < 100; i++) {
      if (!S[i].equals("1")) {
        ret = S[i];
        break;
      }
      if (K == 1+i) {
        break; 
      }
    }
    System.out.println(ret);
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] S = sc.nextLine().split("");
    long K = sc.nextLong();
    String ret = "1";
    for (int i = 0; i < 100; i++) {
      if (!S[i].equals("1")) {
        ret = S[i];
        break;
      }
      if (K == 1+i) {
        break; 
      }
    }
    System.out.println(ret);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] S = sc.nextLine().split("");
    long K = sc.nextLong();
    String ret = "1";
    for (int i = 0; i < 100; i++) {
      if (!S[i].equals("1")) {
        ret = S[i];
        break;
      }
      if (K == 1+i) {
        break; 
      }
    }
    System.out.println(ret);
  } main {
    Scanner sc = new Scanner(System.in);
    String[] S = sc.nextLine().split("");
    long K = sc.nextLong();
    String ret = "1";
    for (int i = 0; i < 100; i++) {
      if (!S[i].equals("1")) {
        ret = S[i];
        break;
      }
      if (K == 1+i) {
        break; 
      }
    }
    System.out.println(ret);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] S = sc.nextLine().split(""); S sc.nextLine().split("") sc.nextLine().split sc.nextLine() sc.nextLine sc "" long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc String ret = "1"; ret "1" for (int i = 0; i < 100; i++) {
      if (!S[i].equals("1")) {
        ret = S[i];
        break;
      }
      if (K == 1+i) {
        break; 
      }
    } int i = 0; int i = 0; i 0 i < 100 i 100 i++ i++ i {
      if (!S[i].equals("1")) {
        ret = S[i];
        break;
      }
      if (K == 1+i) {
        break; 
      }
    } {
      if (!S[i].equals("1")) {
        ret = S[i];
        break;
      }
      if (K == 1+i) {
        break; 
      }
    } if (!S[i].equals("1")) {
        ret = S[i];
        break;
      } !S[i].equals("1") S[i].equals("1") S[i].equals S[i] S i "1" {
        ret = S[i];
        break;
      } ret = S[i] ret S[i] S i break; if (K == 1+i) {
        break; 
      } K == 1+i K 1+i 1 i {
        break; 
      } break; System.out.println(ret) System.out.println System.out System System.out ret String[] args args
import java.util.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] S = sc.nextLine().split("");
    long K = sc.nextLong();
    String ret = "1";
    for (int i = 0; i < 100; i++) {
      if (!S[i].equals("1")) {
        ret = S[i];
        break;
      }
      if (K == 1+i) {
        break; 
      }
    }
    System.out.println(ret);
  }
}