import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] c = sc.next().toCharArray();
		long k = sc.nextLong();
		boolean b = true;
		int i = 0;
		for (; i < c.length; i++) {
			if (c[i] != '1') {
				b = false;
				break;
			}
		}
		if (b) {
			System.out.println(1);
		} else {
			if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] c = sc.next().toCharArray();
		long k = sc.nextLong();
		boolean b = true;
		int i = 0;
		for (; i < c.length; i++) {
			if (c[i] != '1') {
				b = false;
				break;
			}
		}
		if (b) {
			System.out.println(1);
		} else {
			if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] c = sc.next().toCharArray();
		long k = sc.nextLong();
		boolean b = true;
		int i = 0;
		for (; i < c.length; i++) {
			if (c[i] != '1') {
				b = false;
				break;
			}
		}
		if (b) {
			System.out.println(1);
		} else {
			if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] c = sc.next().toCharArray();
		long k = sc.nextLong();
		boolean b = true;
		int i = 0;
		for (; i < c.length; i++) {
			if (c[i] != '1') {
				b = false;
				break;
			}
		}
		if (b) {
			System.out.println(1);
		} else {
			if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() char[] c = sc.next().toCharArray(); c sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc long k = sc.nextLong(); k sc.nextLong() sc.nextLong sc boolean b = true; b true int i = 0; i 0 for (; i < c.length; i++) {
			if (c[i] != '1') {
				b = false;
				break;
			}
		} ; i < c.length i c.length c c.length i++ i++ i {
			if (c[i] != '1') {
				b = false;
				break;
			}
		} {
			if (c[i] != '1') {
				b = false;
				break;
			}
		} if (c[i] != '1') {
				b = false;
				break;
			} c[i] != '1' c[i] c i '1' {
				b = false;
				break;
			} b = false b false break; if (b) {
			System.out.println(1);
		} else {
			if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			}
		} b {
			System.out.println(1);
		} System.out.println(1) System.out.println System.out System System.out 1 {
			if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			}
		} if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			} k < i + 1 k i + 1 i 1 {
				System.out.println(1);
			} System.out.println(1) System.out.println System.out System System.out 1 {
				System.out.println(c[i]);
			} System.out.println(c[i]) System.out.println System.out System System.out c[i] c i String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] c = sc.next().toCharArray();
		long k = sc.nextLong();
		boolean b = true;
		int i = 0;
		for (; i < c.length; i++) {
			if (c[i] != '1') {
				b = false;
				break;
			}
		}
		if (b) {
			System.out.println(1);
		} else {
			if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] c = sc.next().toCharArray();
		long k = sc.nextLong();
		boolean b = true;
		int i = 0;
		for (; i < c.length; i++) {
			if (c[i] != '1') {
				b = false;
				break;
			}
		}
		if (b) {
			System.out.println(1);
		} else {
			if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] c = sc.next().toCharArray();
		long k = sc.nextLong();
		boolean b = true;
		int i = 0;
		for (; i < c.length; i++) {
			if (c[i] != '1') {
				b = false;
				break;
			}
		}
		if (b) {
			System.out.println(1);
		} else {
			if (k < i + 1) {
				System.out.println(1);
			} else {
				System.out.println(c[i]);
			}
		}
	}
}
