
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}


	public void run() {
		Scanner sc = new Scanner(System.in);
		char s[] = sc.next().toCharArray();
		long k=sc.nextLong();
		char ans  = '1';
		for(int i=0; i<s.length; i++) {
			if(s[i] != '1') {
				if((long)i+1<=k) {
					ans = s[i];
				}
				break;
			}
		}
		System.out.println(ans);
		sc.close();
	}


} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}


	public void run() {
		Scanner sc = new Scanner(System.in);
		char s[] = sc.next().toCharArray();
		long k=sc.nextLong();
		char ans  = '1';
		for(int i=0; i<s.length; i++) {
			if(s[i] != '1') {
				if((long)i+1<=k) {
					ans = s[i];
				}
				break;
			}
		}
		System.out.println(ans);
		sc.close();
	}


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


	public void run() {
		Scanner sc = new Scanner(System.in);
		char s[] = sc.next().toCharArray();
		long k=sc.nextLong();
		char ans  = '1';
		for(int i=0; i<s.length; i++) {
			if(s[i] != '1') {
				if((long)i+1<=k) {
					ans = s[i];
				}
				break;
			}
		}
		System.out.println(ans);
		sc.close();
	}


} public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}


	public void run() {
		Scanner sc = new Scanner(System.in);
		char s[] = sc.next().toCharArray();
		long k=sc.nextLong();
		char ans  = '1';
		for(int i=0; i<s.length; i++) {
			if(s[i] != '1') {
				if((long)i+1<=k) {
					ans = s[i];
				}
				break;
			}
		}
		System.out.println(ans);
		sc.close();
	}


} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}


	public void run() {
		Scanner sc = new Scanner(System.in);
		char s[] = sc.next().toCharArray();
		long k=sc.nextLong();
		char ans  = '1';
		for(int i=0; i<s.length; i++) {
			if(s[i] != '1') {
				if((long)i+1<=k) {
					ans = s[i];
				}
				break;
			}
		}
		System.out.println(ans);
		sc.close();
	}


}
