import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String str=sc.nextLine();
		long k=sc.nextLong();
		long[] ranran=new long[100];
		char[] ctr=str.toCharArray();
		
		int j=0;
		try {
			while(ctr[j]=='1') {
				j++;
			}
		} catch (Exception e) {
			j--;
		}
		
		if(j>=k)System.out.println(1);
		else System.out.println(String.valueOf(ctr[j]));
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String str=sc.nextLine();
		long k=sc.nextLong();
		long[] ranran=new long[100];
		char[] ctr=str.toCharArray();
		
		int j=0;
		try {
			while(ctr[j]=='1') {
				j++;
			}
		} catch (Exception e) {
			j--;
		}
		
		if(j>=k)System.out.println(1);
		else System.out.println(String.valueOf(ctr[j]));
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String str=sc.nextLine();
		long k=sc.nextLong();
		long[] ranran=new long[100];
		char[] ctr=str.toCharArray();
		
		int j=0;
		try {
			while(ctr[j]=='1') {
				j++;
			}
		} catch (Exception e) {
			j--;
		}
		
		if(j>=k)System.out.println(1);
		else System.out.println(String.valueOf(ctr[j]));
	} main {
		Scanner sc=new Scanner(System.in);
		String str=sc.nextLine();
		long k=sc.nextLong();
		long[] ranran=new long[100];
		char[] ctr=str.toCharArray();
		
		int j=0;
		try {
			while(ctr[j]=='1') {
				j++;
			}
		} catch (Exception e) {
			j--;
		}
		
		if(j>=k)System.out.println(1);
		else System.out.println(String.valueOf(ctr[j]));
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String str=sc.nextLine(); str sc.nextLine() sc.nextLine sc long k=sc.nextLong(); k sc.nextLong() sc.nextLong sc long[] ranran=new long[100]; ranran new long[100] 100 char[] ctr=str.toCharArray(); ctr str.toCharArray() str.toCharArray str int j=0; j 0 try {
			while(ctr[j]=='1') {
				j++;
			}
		} catch (Exception e) {
			j--;
		} catch (Exception e) {
			j--;
		} Exception e {
			j--;
		} j-- j {
			while(ctr[j]=='1') {
				j++;
			}
		} while(ctr[j]=='1') {
				j++;
			} ctr[j]=='1' ctr[j] ctr j '1' {
				j++;
			} j++ j if(j>=k)System.out.println(1);
		else System.out.println(String.valueOf(ctr[j])); j>=k j k System.out.println(1) System.out.println System.out System System.out 1 System.out.println(String.valueOf(ctr[j])) System.out.println System.out System System.out String.valueOf(ctr[j]) String.valueOf String ctr[j] ctr j String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String str=sc.nextLine();
		long k=sc.nextLong();
		long[] ranran=new long[100];
		char[] ctr=str.toCharArray();
		
		int j=0;
		try {
			while(ctr[j]=='1') {
				j++;
			}
		} catch (Exception e) {
			j--;
		}
		
		if(j>=k)System.out.println(1);
		else System.out.println(String.valueOf(ctr[j]));
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String str=sc.nextLine();
		long k=sc.nextLong();
		long[] ranran=new long[100];
		char[] ctr=str.toCharArray();
		
		int j=0;
		try {
			while(ctr[j]=='1') {
				j++;
			}
		} catch (Exception e) {
			j--;
		}
		
		if(j>=k)System.out.println(1);
		else System.out.println(String.valueOf(ctr[j]));
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String str=sc.nextLine();
		long k=sc.nextLong();
		long[] ranran=new long[100];
		char[] ctr=str.toCharArray();
		
		int j=0;
		try {
			while(ctr[j]=='1') {
				j++;
			}
		} catch (Exception e) {
			j--;
		}
		
		if(j>=k)System.out.println(1);
		else System.out.println(String.valueOf(ctr[j]));
	}
}
