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();
      for(int i = 0;i < s.length();i++){
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      }
      System.out.println(1);
    }
} 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();
      for(int i = 0;i < s.length();i++){
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      }
      System.out.println(1);
    }
} Main public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      String s = sc.next();
      long k = sc.nextLong();
      for(int i = 0;i < s.length();i++){
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      }
      System.out.println(1);
    } main {
    	Scanner sc = new Scanner(System.in);
      String s = sc.next();
      long k = sc.nextLong();
      for(int i = 0;i < s.length();i++){
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      }
      System.out.println(1);
    } 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 for(int i = 0;i < s.length();i++){
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      } {
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      } if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        } s.substring(i,i+1).equals("1")&&k==i+1 s.substring(i,i+1).equals("1") s.substring(i,i+1).equals s.substring(i,i+1) s.substring s i i+1 i 1 "1" k==i+1 k i+1 i 1 {
        	System.out.println(1);
            return;
        } System.out.println(1) System.out.println System.out System System.out 1 return; if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        } !(s.substring(i,i+1).equals("1")) (s.substring(i,i+1).equals("1")) s.substring(i,i+1).equals s.substring(i,i+1) s.substring s i i+1 i 1 "1" {
        	System.out.println(s.substring(i,i+1));
            return;
        } System.out.println(s.substring(i,i+1)) System.out.println System.out System System.out s.substring(i,i+1) s.substring s i i+1 i 1 return; System.out.println(1) System.out.println System.out System System.out 1 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();
      for(int i = 0;i < s.length();i++){
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      }
      System.out.println(1);
    }
} public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      String s = sc.next();
      long k = sc.nextLong();
      for(int i = 0;i < s.length();i++){
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      }
      System.out.println(1);
    }
} 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();
      for(int i = 0;i < s.length();i++){
      	if(s.substring(i,i+1).equals("1")&&k==i+1){
        	System.out.println(1);
            return;
        }
        else if(!(s.substring(i,i+1).equals("1"))){
        	System.out.println(s.substring(i,i+1));
            return;
        }
      }
      System.out.println(1);
    }
}
