import java.util.Scanner;

class Main{

	public static void main(String[] args) {


		Scanner scan = new Scanner(System.in);
		String N = scan.next();
		long M = scan.nextLong();

		int count = 0;
		int numone=0;
		while(count < N.length()){
			String first = N.substring(count,count+1);
			if(first.equals("1")){
				numone++;
			}else{
				break;
			}
			
			count++;
		}
		
		if(M <= numone){
			System.out.println("1");
		}	
		else{
			System.out.println(N.substring(count,count+1));
		}




	}



} import java.util.Scanner; Scanner java.util class Main{

	public static void main(String[] args) {


		Scanner scan = new Scanner(System.in);
		String N = scan.next();
		long M = scan.nextLong();

		int count = 0;
		int numone=0;
		while(count < N.length()){
			String first = N.substring(count,count+1);
			if(first.equals("1")){
				numone++;
			}else{
				break;
			}
			
			count++;
		}
		
		if(M <= numone){
			System.out.println("1");
		}	
		else{
			System.out.println(N.substring(count,count+1));
		}




	}



} Main public static void main(String[] args) {


		Scanner scan = new Scanner(System.in);
		String N = scan.next();
		long M = scan.nextLong();

		int count = 0;
		int numone=0;
		while(count < N.length()){
			String first = N.substring(count,count+1);
			if(first.equals("1")){
				numone++;
			}else{
				break;
			}
			
			count++;
		}
		
		if(M <= numone){
			System.out.println("1");
		}	
		else{
			System.out.println(N.substring(count,count+1));
		}




	} main {


		Scanner scan = new Scanner(System.in);
		String N = scan.next();
		long M = scan.nextLong();

		int count = 0;
		int numone=0;
		while(count < N.length()){
			String first = N.substring(count,count+1);
			if(first.equals("1")){
				numone++;
			}else{
				break;
			}
			
			count++;
		}
		
		if(M <= numone){
			System.out.println("1");
		}	
		else{
			System.out.println(N.substring(count,count+1));
		}




	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String N = scan.next(); N scan.next() scan.next scan long M = scan.nextLong(); M scan.nextLong() scan.nextLong scan int count = 0; count 0 int numone=0; numone 0 while(count < N.length()){
			String first = N.substring(count,count+1);
			if(first.equals("1")){
				numone++;
			}else{
				break;
			}
			
			count++;
		} count < N.length() count N.length() N.length N {
			String first = N.substring(count,count+1);
			if(first.equals("1")){
				numone++;
			}else{
				break;
			}
			
			count++;
		} String first = N.substring(count,count+1); first N.substring(count,count+1) N.substring N count count+1 count 1 if(first.equals("1")){
				numone++;
			}else{
				break;
			} first.equals("1") first.equals first "1" {
				numone++;
			} numone++ numone {
				break;
			} break; count++ count if(M <= numone){
			System.out.println("1");
		}	
		else{
			System.out.println(N.substring(count,count+1));
		} M <= numone M numone {
			System.out.println("1");
		} System.out.println("1") System.out.println System.out System System.out "1" {
			System.out.println(N.substring(count,count+1));
		} System.out.println(N.substring(count,count+1)) System.out.println System.out System System.out N.substring(count,count+1) N.substring N count count+1 count 1 String[] args args
import java.util.Scanner;

class Main{

	public static void main(String[] args) {


		Scanner scan = new Scanner(System.in);
		String N = scan.next();
		long M = scan.nextLong();

		int count = 0;
		int numone=0;
		while(count < N.length()){
			String first = N.substring(count,count+1);
			if(first.equals("1")){
				numone++;
			}else{
				break;
			}
			
			count++;
		}
		
		if(M <= numone){
			System.out.println("1");
		}	
		else{
			System.out.println(N.substring(count,count+1));
		}




	}



}