import java.util.Scanner;

public class Main{
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		String str = scn.nextLine();
		char[] S = str.toCharArray();
		long K = scn.nextLong();
		int ans = 0;
		for(int i = 0;i < str.length();i++) {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		}
		System.out.println(S[ans]);
		scn.close();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		String str = scn.nextLine();
		char[] S = str.toCharArray();
		long K = scn.nextLong();
		int ans = 0;
		for(int i = 0;i < str.length();i++) {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		}
		System.out.println(S[ans]);
		scn.close();
	}
} Main public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		String str = scn.nextLine();
		char[] S = str.toCharArray();
		long K = scn.nextLong();
		int ans = 0;
		for(int i = 0;i < str.length();i++) {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		}
		System.out.println(S[ans]);
		scn.close();
	} main {
		Scanner scn = new Scanner(System.in);
		String str = scn.nextLine();
		char[] S = str.toCharArray();
		long K = scn.nextLong();
		int ans = 0;
		for(int i = 0;i < str.length();i++) {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		}
		System.out.println(S[ans]);
		scn.close();
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) String str = scn.nextLine(); str scn.nextLine() scn.nextLine scn char[] S = str.toCharArray(); S str.toCharArray() str.toCharArray str long K = scn.nextLong(); K scn.nextLong() scn.nextLong scn int ans = 0; ans 0 for(int i = 0;i < str.length();i++) {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		} int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		} {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		} if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			} (S[i])=='1' (S[i]) S i '1' {
				K--;
			} K-- K {
				ans = i;
				break;
			} ans = i ans i break; if(K==0) {
				ans = i;
				break;
			} K==0 K 0 {
				ans = i;
				break;
			} ans = i ans i break; System.out.println(S[ans]) System.out.println System.out System System.out S[ans] S ans scn.close() scn.close scn String args[] args public class Main{
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		String str = scn.nextLine();
		char[] S = str.toCharArray();
		long K = scn.nextLong();
		int ans = 0;
		for(int i = 0;i < str.length();i++) {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		}
		System.out.println(S[ans]);
		scn.close();
	}
} public class Main{
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		String str = scn.nextLine();
		char[] S = str.toCharArray();
		long K = scn.nextLong();
		int ans = 0;
		for(int i = 0;i < str.length();i++) {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		}
		System.out.println(S[ans]);
		scn.close();
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		String str = scn.nextLine();
		char[] S = str.toCharArray();
		long K = scn.nextLong();
		int ans = 0;
		for(int i = 0;i < str.length();i++) {
			if((S[i])=='1') {
				K--;
			}else{
				ans = i;
				break;
			}
			if(K==0) {
				ans = i;
				break;
			}
		}
		System.out.println(S[ans]);
		scn.close();
	}
}
