import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner stdIn=new Scanner(System.in);
		String s=stdIn.next();
		long k=stdIn.nextLong();
		int S=0;
		int z=0;
		while(z<s.length()){
			S=Integer.valueOf(s.substring(z,z+1));
			if(S!=1)
				break;
			else
				if(z+1==k)
					break;
			z++;
		}
		System.out.println(S);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception{
		Scanner stdIn=new Scanner(System.in);
		String s=stdIn.next();
		long k=stdIn.nextLong();
		int S=0;
		int z=0;
		while(z<s.length()){
			S=Integer.valueOf(s.substring(z,z+1));
			if(S!=1)
				break;
			else
				if(z+1==k)
					break;
			z++;
		}
		System.out.println(S);
	}
} Main public static void main(String[] args) throws Exception{
		Scanner stdIn=new Scanner(System.in);
		String s=stdIn.next();
		long k=stdIn.nextLong();
		int S=0;
		int z=0;
		while(z<s.length()){
			S=Integer.valueOf(s.substring(z,z+1));
			if(S!=1)
				break;
			else
				if(z+1==k)
					break;
			z++;
		}
		System.out.println(S);
	} main {
		Scanner stdIn=new Scanner(System.in);
		String s=stdIn.next();
		long k=stdIn.nextLong();
		int S=0;
		int z=0;
		while(z<s.length()){
			S=Integer.valueOf(s.substring(z,z+1));
			if(S!=1)
				break;
			else
				if(z+1==k)
					break;
			z++;
		}
		System.out.println(S);
	} Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) String s=stdIn.next(); s stdIn.next() stdIn.next stdIn long k=stdIn.nextLong(); k stdIn.nextLong() stdIn.nextLong stdIn int S=0; S 0 int z=0; z 0 while(z<s.length()){
			S=Integer.valueOf(s.substring(z,z+1));
			if(S!=1)
				break;
			else
				if(z+1==k)
					break;
			z++;
		} z<s.length() z s.length() s.length s {
			S=Integer.valueOf(s.substring(z,z+1));
			if(S!=1)
				break;
			else
				if(z+1==k)
					break;
			z++;
		} S=Integer.valueOf(s.substring(z,z+1)) S Integer.valueOf(s.substring(z,z+1)) Integer.valueOf Integer s.substring(z,z+1) s.substring s z z+1 z 1 if(S!=1)
				break;
			else
				if(z+1==k)
					break; S!=1 S 1 break; if(z+1==k)
					break; z+1==k z+1 z 1 k break; z++ z System.out.println(S) System.out.println System.out System System.out S String[] args args public class Main {
	public static void main(String[] args) throws Exception{
		Scanner stdIn=new Scanner(System.in);
		String s=stdIn.next();
		long k=stdIn.nextLong();
		int S=0;
		int z=0;
		while(z<s.length()){
			S=Integer.valueOf(s.substring(z,z+1));
			if(S!=1)
				break;
			else
				if(z+1==k)
					break;
			z++;
		}
		System.out.println(S);
	}
} public class Main {
	public static void main(String[] args) throws Exception{
		Scanner stdIn=new Scanner(System.in);
		String s=stdIn.next();
		long k=stdIn.nextLong();
		int S=0;
		int z=0;
		while(z<s.length()){
			S=Integer.valueOf(s.substring(z,z+1));
			if(S!=1)
				break;
			else
				if(z+1==k)
					break;
			z++;
		}
		System.out.println(S);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner stdIn=new Scanner(System.in);
		String s=stdIn.next();
		long k=stdIn.nextLong();
		int S=0;
		int z=0;
		while(z<s.length()){
			S=Integer.valueOf(s.substring(z,z+1));
			if(S!=1)
				break;
			else
				if(z+1==k)
					break;
			z++;
		}
		System.out.println(S);
	}
}