import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		sc.close();

		int onecount = 0;
		for(int i = 0 ; i < S.length() ; i++){
			if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			}
		}

		if(onecount >= K){
			System.out.println("1");
		}
		else{
			System.out.println(S.substring(onecount,onecount+1));
		}
	}
} import java.util.Scanner; Scanner 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();
		sc.close();

		int onecount = 0;
		for(int i = 0 ; i < S.length() ; i++){
			if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			}
		}

		if(onecount >= K){
			System.out.println("1");
		}
		else{
			System.out.println(S.substring(onecount,onecount+1));
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		sc.close();

		int onecount = 0;
		for(int i = 0 ; i < S.length() ; i++){
			if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			}
		}

		if(onecount >= K){
			System.out.println("1");
		}
		else{
			System.out.println(S.substring(onecount,onecount+1));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		sc.close();

		int onecount = 0;
		for(int i = 0 ; i < S.length() ; i++){
			if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			}
		}

		if(onecount >= K){
			System.out.println("1");
		}
		else{
			System.out.println(S.substring(onecount,onecount+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 sc.close() sc.close sc int onecount = 0; onecount 0 for(int i = 0 ; i < S.length() ; i++){
			if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			}
		} 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"))
				onecount++;
			else{
				break;
			}
		} {
			if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			}
		} if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			} 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" onecount++ onecount {
				break;
			} break; if(onecount >= K){
			System.out.println("1");
		}
		else{
			System.out.println(S.substring(onecount,onecount+1));
		} onecount >= K onecount K {
			System.out.println("1");
		} System.out.println("1") System.out.println System.out System System.out "1" {
			System.out.println(S.substring(onecount,onecount+1));
		} System.out.println(S.substring(onecount,onecount+1)) System.out.println System.out System System.out S.substring(onecount,onecount+1) S.substring S onecount onecount+1 onecount 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();
		sc.close();

		int onecount = 0;
		for(int i = 0 ; i < S.length() ; i++){
			if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			}
		}

		if(onecount >= K){
			System.out.println("1");
		}
		else{
			System.out.println(S.substring(onecount,onecount+1));
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		sc.close();

		int onecount = 0;
		for(int i = 0 ; i < S.length() ; i++){
			if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			}
		}

		if(onecount >= K){
			System.out.println("1");
		}
		else{
			System.out.println(S.substring(onecount,onecount+1));
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		long K = sc.nextLong();
		sc.close();

		int onecount = 0;
		for(int i = 0 ; i < S.length() ; i++){
			if(S.substring(i,i+1).equals("1"))
				onecount++;
			else{
				break;
			}
		}

		if(onecount >= K){
			System.out.println("1");
		}
		else{
			System.out.println(S.substring(onecount,onecount+1));
		}
	}
}
