import java.util.Scanner;

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

	}

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

	}

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

	} main {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.nextLine().toCharArray();
		long K = sc.nextLong();
		sc.close();
		char a = '1';
		for(int i=0;i<K;i++){
			if(i >= S.length) break;
			if(S[i] != '1'){
				a = S[i];
				break;
			}
		}
		System.out.println(a);

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

	}

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

	}

} Main
import java.util.Scanner;

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

	}

}