import java.io.*;
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		String[] strs = read(2);
		
		String s = strs[0];
		long k = Long.parseLong(strs[1]);
		
		char c = '1';
		for (int i = 0; i < s.length() && i < k; i++) {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		}
		
		System.out.println(c);
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
	
	public static void main(String[] args) {
		String[] strs = read(2);
		
		String s = strs[0];
		long k = Long.parseLong(strs[1]);
		
		char c = '1';
		for (int i = 0; i < s.length() && i < k; i++) {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		}
		
		System.out.println(c);
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
} Main public static void main(String[] args) {
		String[] strs = read(2);
		
		String s = strs[0];
		long k = Long.parseLong(strs[1]);
		
		char c = '1';
		for (int i = 0; i < s.length() && i < k; i++) {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		}
		
		System.out.println(c);
	} main {
		String[] strs = read(2);
		
		String s = strs[0];
		long k = Long.parseLong(strs[1]);
		
		char c = '1';
		for (int i = 0; i < s.length() && i < k; i++) {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		}
		
		System.out.println(c);
	} String[] strs = read(2); strs read(2) read 2 String s = strs[0]; s strs[0] strs 0 long k = Long.parseLong(strs[1]); k Long.parseLong(strs[1]) Long.parseLong Long strs[1] strs 1 char c = '1'; c '1' for (int i = 0; i < s.length() && i < k; i++) {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		} int i = 0; int i = 0; i 0 i < s.length() && i < k i < s.length() i s.length() s.length s i < k i k i++ i++ i {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		} {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		} c = s.charAt(i) c s.charAt(i) s.charAt s i if (c != '1') {
				break;
			} c != '1' c '1' {
				break;
			} break; System.out.println(c) System.out.println System.out System System.out c String[] args args private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	} read {
		List<String> strList = new ArrayList<>();
		
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	} List<String> strList = new ArrayList<>(); strList new ArrayList<>() try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		} catch (IOException e) {
		} IOException e {
		} {
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			} int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
				strList.add(br.readLine());
			} {
				strList.add(br.readLine());
			} strList.add(br.readLine()) strList.add strList br.readLine() br.readLine br return strList.toArray(new String[0]); strList.toArray(new String[0]) strList.toArray strList new String[0] 0 int len len public class Main {
	
	public static void main(String[] args) {
		String[] strs = read(2);
		
		String s = strs[0];
		long k = Long.parseLong(strs[1]);
		
		char c = '1';
		for (int i = 0; i < s.length() && i < k; i++) {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		}
		
		System.out.println(c);
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
} public class Main {
	
	public static void main(String[] args) {
		String[] strs = read(2);
		
		String s = strs[0];
		long k = Long.parseLong(strs[1]);
		
		char c = '1';
		for (int i = 0; i < s.length() && i < k; i++) {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		}
		
		System.out.println(c);
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
} Main
import java.io.*;
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		String[] strs = read(2);
		
		String s = strs[0];
		long k = Long.parseLong(strs[1]);
		
		char c = '1';
		for (int i = 0; i < s.length() && i < k; i++) {
			c = s.charAt(i);
			if (c != '1') {
				break;
			}
		}
		
		System.out.println(c);
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
}
