import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Long K = sc.nextLong();
    char ans = '1';
    int count = 0;
    for(int i=0; i<K; i++){
      if(S.charAt(i) != '1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  }

  public static int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Long K = sc.nextLong();
    char ans = '1';
    int count = 0;
    for(int i=0; i<K; i++){
      if(S.charAt(i) != '1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  }

  public static int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Long K = sc.nextLong();
    char ans = '1';
    int count = 0;
    for(int i=0; i<K; i++){
      if(S.charAt(i) != '1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Long K = sc.nextLong();
    char ans = '1';
    int count = 0;
    for(int i=0; i<K; i++){
      if(S.charAt(i) != '1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  } 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 char ans = '1'; ans '1' int count = 0; count 0 for(int i=0; i<K; i++){
      if(S.charAt(i) != '1'){
        ans = S.charAt(i);
        break;
      }
    } int i=0; int i=0; i 0 i<K i K i++ i++ i {
      if(S.charAt(i) != '1'){
        ans = S.charAt(i);
        break;
      }
    } {
      if(S.charAt(i) != '1'){
        ans = S.charAt(i);
        break;
      }
    } if(S.charAt(i) != '1'){
        ans = S.charAt(i);
        break;
      } S.charAt(i) != '1' S.charAt(i) S.charAt S i '1' {
        ans = S.charAt(i);
        break;
      } ans = S.charAt(i) ans S.charAt(i) S.charAt S i break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
  } gcd {
    if(b == 0) return a;
    return gcd(b, a%b);
  } if(b == 0) return a; b == 0 b 0 return a; a return gcd(b, a%b); gcd(b, a%b) gcd b a%b a b int a a int b b
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Long K = sc.nextLong();
    char ans = '1';
    int count = 0;
    for(int i=0; i<K; i++){
      if(S.charAt(i) != '1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  }

  public static int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
  }
}