import java.util.*;
import java.util.TreeMap;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    int cnt = 0;
    while ((cnt < K - 1)) {
      if (S.charAt(cnt) != '1')
        break;
      cnt++;
    }
    System.out.println(S.charAt(cnt));

  }
} import java.util.*; util.* java import java.util.TreeMap; TreeMap 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 cnt = 0;
    while ((cnt < K - 1)) {
      if (S.charAt(cnt) != '1')
        break;
      cnt++;
    }
    System.out.println(S.charAt(cnt));

  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    int cnt = 0;
    while ((cnt < K - 1)) {
      if (S.charAt(cnt) != '1')
        break;
      cnt++;
    }
    System.out.println(S.charAt(cnt));

  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    int cnt = 0;
    while ((cnt < K - 1)) {
      if (S.charAt(cnt) != '1')
        break;
      cnt++;
    }
    System.out.println(S.charAt(cnt));

  } 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 cnt = 0; cnt 0 while ((cnt < K - 1)) {
      if (S.charAt(cnt) != '1')
        break;
      cnt++;
    } (cnt < K - 1) cnt K - 1 K 1 {
      if (S.charAt(cnt) != '1')
        break;
      cnt++;
    } if (S.charAt(cnt) != '1')
        break; S.charAt(cnt) != '1' S.charAt(cnt) S.charAt S cnt '1' break; cnt++ cnt System.out.println(S.charAt(cnt)) System.out.println System.out System System.out S.charAt(cnt) S.charAt S cnt 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 cnt = 0;
    while ((cnt < K - 1)) {
      if (S.charAt(cnt) != '1')
        break;
      cnt++;
    }
    System.out.println(S.charAt(cnt));

  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    int cnt = 0;
    while ((cnt < K - 1)) {
      if (S.charAt(cnt) != '1')
        break;
      cnt++;
    }
    System.out.println(S.charAt(cnt));

  }
} Main
import java.util.*;
import java.util.TreeMap;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    long K = sc.nextLong();
    int cnt = 0;
    while ((cnt < K - 1)) {
      if (S.charAt(cnt) != '1')
        break;
      cnt++;
    }
    System.out.println(S.charAt(cnt));

  }
}
