import java.util.Scanner;
 
public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    String S = scanner.next();
    long K = scanner.nextLong();
    char ans = '1';
    for(int i = 0; i < Math.min(S.length(), K); i++){
      if(S.charAt(i)!='1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    String S = scanner.next();
    long K = scanner.nextLong();
    char ans = '1';
    for(int i = 0; i < Math.min(S.length(), K); i++){
      if(S.charAt(i)!='1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    String S = scanner.next();
    long K = scanner.nextLong();
    char ans = '1';
    for(int i = 0; i < Math.min(S.length(), K); i++){
      if(S.charAt(i)!='1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  } main {
    Scanner scanner = new Scanner(System.in);
    String S = scanner.next();
    long K = scanner.nextLong();
    char ans = '1';
    for(int i = 0; i < Math.min(S.length(), K); i++){
      if(S.charAt(i)!='1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String S = scanner.next(); S scanner.next() scanner.next scanner long K = scanner.nextLong(); K scanner.nextLong() scanner.nextLong scanner char ans = '1'; ans '1' for(int i = 0; i < Math.min(S.length(), K); i++){
      if(S.charAt(i)!='1'){
        ans = S.charAt(i);
        break;
      }
    } int i = 0; int i = 0; i 0 i < Math.min(S.length(), K) i Math.min(S.length(), K) Math.min Math S.length() S.length S 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 class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    String S = scanner.next();
    long K = scanner.nextLong();
    char ans = '1';
    for(int i = 0; i < Math.min(S.length(), K); i++){
      if(S.charAt(i)!='1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  }
} public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    String S = scanner.next();
    long K = scanner.nextLong();
    char ans = '1';
    for(int i = 0; i < Math.min(S.length(), K); i++){
      if(S.charAt(i)!='1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  }
} Main
import java.util.Scanner;
 
public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    String S = scanner.next();
    long K = scanner.nextLong();
    char ans = '1';
    for(int i = 0; i < Math.min(S.length(), K); i++){
      if(S.charAt(i)!='1'){
        ans = S.charAt(i);
        break;
      }
    }
    System.out.println(ans);
  }
}