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();

		char c[] = s.toCharArray();
		int one = 0;
		if (c[0] == '1') {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		}
		long i=one;

		// 1からiまで
if(k<=i){
	System.out.println(1);
}else{
	System.out.println(c[one]);
}
	}
} 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();

		char c[] = s.toCharArray();
		int one = 0;
		if (c[0] == '1') {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		}
		long i=one;

		// 1からiまで
if(k<=i){
	System.out.println(1);
}else{
	System.out.println(c[one]);
}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		long k = sc.nextLong();

		char c[] = s.toCharArray();
		int one = 0;
		if (c[0] == '1') {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		}
		long i=one;

		// 1からiまで
if(k<=i){
	System.out.println(1);
}else{
	System.out.println(c[one]);
}
	} main {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		long k = sc.nextLong();

		char c[] = s.toCharArray();
		int one = 0;
		if (c[0] == '1') {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		}
		long i=one;

		// 1からiまで
if(k<=i){
	System.out.println(1);
}else{
	System.out.println(c[one]);
}
	} 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 char c[] = s.toCharArray(); c s.toCharArray() s.toCharArray s int one = 0; one 0 if (c[0] == '1') {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		} c[0] == '1' c[0] c 0 '1' {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		} while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			} c[one] == '1' c[one] c one '1' {
				one++;
				if(one==s.length()){

					break;
				}
			} one++ one if(one==s.length()){

					break;
				} one==s.length() one s.length() s.length s {

					break;
				} break; long i=one; i one if(k<=i){
	System.out.println(1);
}else{
	System.out.println(c[one]);
} k<=i k i {
	System.out.println(1);
} System.out.println(1) System.out.println System.out System System.out 1 {
	System.out.println(c[one]);
} System.out.println(c[one]) System.out.println System.out System System.out c[one] c one 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();

		char c[] = s.toCharArray();
		int one = 0;
		if (c[0] == '1') {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		}
		long i=one;

		// 1からiまで
if(k<=i){
	System.out.println(1);
}else{
	System.out.println(c[one]);
}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		long k = sc.nextLong();

		char c[] = s.toCharArray();
		int one = 0;
		if (c[0] == '1') {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		}
		long i=one;

		// 1からiまで
if(k<=i){
	System.out.println(1);
}else{
	System.out.println(c[one]);
}
	}
} 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();

		char c[] = s.toCharArray();
		int one = 0;
		if (c[0] == '1') {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		}
		long i=one;

		// 1からiまで
if(k<=i){
	System.out.println(1);
}else{
	System.out.println(c[one]);
}
	}
}