import 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 temp = 0;
    for (int i=0;i<S.length();i++){
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    }

    if (K < temp+1){
        System.out.println(1);
    }
    else{
        System.out.println(S.charAt(temp));
    }
    return;
  }
} import java.util.*; util.* java public class Main{
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    String S = sc.next();
    long K = sc.nextLong();
    int temp = 0;
    for (int i=0;i<S.length();i++){
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    }

    if (K < temp+1){
        System.out.println(1);
    }
    else{
        System.out.println(S.charAt(temp));
    }
    return;
  }
} Main public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    String S = sc.next();
    long K = sc.nextLong();
    int temp = 0;
    for (int i=0;i<S.length();i++){
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    }

    if (K < temp+1){
        System.out.println(1);
    }
    else{
        System.out.println(S.charAt(temp));
    }
    return;
  } main {
    Scanner sc = new Scanner(System.in);

    String S = sc.next();
    long K = sc.nextLong();
    int temp = 0;
    for (int i=0;i<S.length();i++){
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    }

    if (K < temp+1){
        System.out.println(1);
    }
    else{
        System.out.println(S.charAt(temp));
    }
    return;
  } 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 temp = 0; temp 0 for (int i=0;i<S.length();i++){
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    } int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    } {
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    } if (S.charAt(i) != '1'){
            temp = i;
            break;
        } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
            temp = i;
            break;
        } temp = i temp i break; if (K < temp+1){
        System.out.println(1);
    }
    else{
        System.out.println(S.charAt(temp));
    } K < temp+1 K temp+1 temp 1 {
        System.out.println(1);
    } System.out.println(1) System.out.println System.out System System.out 1 {
        System.out.println(S.charAt(temp));
    } System.out.println(S.charAt(temp)) System.out.println System.out System System.out S.charAt(temp) S.charAt S temp return; 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 temp = 0;
    for (int i=0;i<S.length();i++){
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    }

    if (K < temp+1){
        System.out.println(1);
    }
    else{
        System.out.println(S.charAt(temp));
    }
    return;
  }
} public class Main{
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    String S = sc.next();
    long K = sc.nextLong();
    int temp = 0;
    for (int i=0;i<S.length();i++){
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    }

    if (K < temp+1){
        System.out.println(1);
    }
    else{
        System.out.println(S.charAt(temp));
    }
    return;
  }
} Main
import 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 temp = 0;
    for (int i=0;i<S.length();i++){
        if (S.charAt(i) != '1'){
            temp = i;
            break;
        }
    }

    if (K < temp+1){
        System.out.println(1);
    }
    else{
        System.out.println(S.charAt(temp));
    }
    return;
  }
}