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