import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    long k = Long.parseLong(sc.next());
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) ch[i] = str.charAt(i);
    int count = 0;
    char ans = str.charAt(0);
    while(count < k) {
      if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      }
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    long k = Long.parseLong(sc.next());
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) ch[i] = str.charAt(i);
    int count = 0;
    char ans = str.charAt(0);
    while(count < k) {
      if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      }
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    long k = Long.parseLong(sc.next());
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) ch[i] = str.charAt(i);
    int count = 0;
    char ans = str.charAt(0);
    while(count < k) {
      if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    long k = Long.parseLong(sc.next());
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) ch[i] = str.charAt(i);
    int count = 0;
    char ans = str.charAt(0);
    while(count < k) {
      if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      }
    }
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc long k = Long.parseLong(sc.next()); k Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc char[] ch = new char[str.length()]; ch new char[str.length()] str.length() str.length str for(int i = 0; i < str.length(); i++) ch[i] = str.charAt(i); int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i ch[i] = str.charAt(i); ch[i] = str.charAt(i) ch[i] ch i str.charAt(i) str.charAt str i int count = 0; count 0 char ans = str.charAt(0); ans str.charAt(0) str.charAt str 0 while(count < k) {
      if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      }
    } count < k count k {
      if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      }
    } if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      } ch[count] == '1' ch[count] ch count '1' {
        count++;
      } count++ count {
        ans = ch[count];
        break;
      } ans = ch[count] ans ch[count] ch count break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    long k = Long.parseLong(sc.next());
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) ch[i] = str.charAt(i);
    int count = 0;
    char ans = str.charAt(0);
    while(count < k) {
      if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      }
    }
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    long k = Long.parseLong(sc.next());
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) ch[i] = str.charAt(i);
    int count = 0;
    char ans = str.charAt(0);
    while(count < k) {
      if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      }
    }
    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    long k = Long.parseLong(sc.next());
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) ch[i] = str.charAt(i);
    int count = 0;
    char ans = str.charAt(0);
    while(count < k) {
      if(ch[count] == '1') {
        count++;
      } else {
        ans = ch[count];
        break;
      }
    }
    System.out.println(ans);
  }
}
