import java.util.Scanner;
import java.util.regex.*;
import java.math.*;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		//int a = sc.nextInt();
		// スペース区切りの整数の入力
		//int b = sc.nextInt();
		//int c = sc.nextInt();
		// 文字列の入力
		//String s = sc.next();
		//1文字ずつ
		//s.atChar(i);
		// 出力
		//System.out.println("");
		//double countx=0;
		String s=sc.next();
		long K=sc.nextLong();
	
		
	
		long aho=5000000000000000L;
		
		int[] nums = new int[s.length()];
		//int[] counts=new int[s.length()];
		int non_one=0;
		//System.out.println(s.charAt(0));
		for(int i=0;i<s.length();i++){
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		}
		if(K<=non_one){
			System.out.println(1);
		}else{
			System.out.println(nums[non_one]);
		}
		
		
		
	}
} import java.util.Scanner; Scanner java.util import java.util.regex.*; regex.* java.util import java.math.*; math.* java public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		//int a = sc.nextInt();
		// スペース区切りの整数の入力
		//int b = sc.nextInt();
		//int c = sc.nextInt();
		// 文字列の入力
		//String s = sc.next();
		//1文字ずつ
		//s.atChar(i);
		// 出力
		//System.out.println("");
		//double countx=0;
		String s=sc.next();
		long K=sc.nextLong();
	
		
	
		long aho=5000000000000000L;
		
		int[] nums = new int[s.length()];
		//int[] counts=new int[s.length()];
		int non_one=0;
		//System.out.println(s.charAt(0));
		for(int i=0;i<s.length();i++){
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		}
		if(K<=non_one){
			System.out.println(1);
		}else{
			System.out.println(nums[non_one]);
		}
		
		
		
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		//int a = sc.nextInt();
		// スペース区切りの整数の入力
		//int b = sc.nextInt();
		//int c = sc.nextInt();
		// 文字列の入力
		//String s = sc.next();
		//1文字ずつ
		//s.atChar(i);
		// 出力
		//System.out.println("");
		//double countx=0;
		String s=sc.next();
		long K=sc.nextLong();
	
		
	
		long aho=5000000000000000L;
		
		int[] nums = new int[s.length()];
		//int[] counts=new int[s.length()];
		int non_one=0;
		//System.out.println(s.charAt(0));
		for(int i=0;i<s.length();i++){
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		}
		if(K<=non_one){
			System.out.println(1);
		}else{
			System.out.println(nums[non_one]);
		}
		
		
		
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		//int a = sc.nextInt();
		// スペース区切りの整数の入力
		//int b = sc.nextInt();
		//int c = sc.nextInt();
		// 文字列の入力
		//String s = sc.next();
		//1文字ずつ
		//s.atChar(i);
		// 出力
		//System.out.println("");
		//double countx=0;
		String s=sc.next();
		long K=sc.nextLong();
	
		
	
		long aho=5000000000000000L;
		
		int[] nums = new int[s.length()];
		//int[] counts=new int[s.length()];
		int non_one=0;
		//System.out.println(s.charAt(0));
		for(int i=0;i<s.length();i++){
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		}
		if(K<=non_one){
			System.out.println(1);
		}else{
			System.out.println(nums[non_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 long aho=5000000000000000L; aho 5000000000000000L int[] nums = new int[s.length()]; nums new int[s.length()] s.length() s.length s int non_one=0; non_one 0 for(int i=0;i<s.length();i++){
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		} {
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		} nums[i]=Character.getNumericValue(s.charAt(i)) nums[i] nums i Character.getNumericValue(s.charAt(i)) Character.getNumericValue Character s.charAt(i) s.charAt s i if(nums[i]!=1){
				non_one=i;
				break;
			} nums[i]!=1 nums[i] nums i 1 {
				non_one=i;
				break;
			} non_one=i non_one i break; if(K<=non_one){
			System.out.println(1);
		}else{
			System.out.println(nums[non_one]);
		} K<=non_one K non_one {
			System.out.println(1);
		} System.out.println(1) System.out.println System.out System System.out 1 {
			System.out.println(nums[non_one]);
		} System.out.println(nums[non_one]) System.out.println System.out System System.out nums[non_one] nums non_one String[] args args public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		//int a = sc.nextInt();
		// スペース区切りの整数の入力
		//int b = sc.nextInt();
		//int c = sc.nextInt();
		// 文字列の入力
		//String s = sc.next();
		//1文字ずつ
		//s.atChar(i);
		// 出力
		//System.out.println("");
		//double countx=0;
		String s=sc.next();
		long K=sc.nextLong();
	
		
	
		long aho=5000000000000000L;
		
		int[] nums = new int[s.length()];
		//int[] counts=new int[s.length()];
		int non_one=0;
		//System.out.println(s.charAt(0));
		for(int i=0;i<s.length();i++){
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		}
		if(K<=non_one){
			System.out.println(1);
		}else{
			System.out.println(nums[non_one]);
		}
		
		
		
	}
} public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		//int a = sc.nextInt();
		// スペース区切りの整数の入力
		//int b = sc.nextInt();
		//int c = sc.nextInt();
		// 文字列の入力
		//String s = sc.next();
		//1文字ずつ
		//s.atChar(i);
		// 出力
		//System.out.println("");
		//double countx=0;
		String s=sc.next();
		long K=sc.nextLong();
	
		
	
		long aho=5000000000000000L;
		
		int[] nums = new int[s.length()];
		//int[] counts=new int[s.length()];
		int non_one=0;
		//System.out.println(s.charAt(0));
		for(int i=0;i<s.length();i++){
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		}
		if(K<=non_one){
			System.out.println(1);
		}else{
			System.out.println(nums[non_one]);
		}
		
		
		
	}
} Main
import java.util.Scanner;
import java.util.regex.*;
import java.math.*;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		//int a = sc.nextInt();
		// スペース区切りの整数の入力
		//int b = sc.nextInt();
		//int c = sc.nextInt();
		// 文字列の入力
		//String s = sc.next();
		//1文字ずつ
		//s.atChar(i);
		// 出力
		//System.out.println("");
		//double countx=0;
		String s=sc.next();
		long K=sc.nextLong();
	
		
	
		long aho=5000000000000000L;
		
		int[] nums = new int[s.length()];
		//int[] counts=new int[s.length()];
		int non_one=0;
		//System.out.println(s.charAt(0));
		for(int i=0;i<s.length();i++){
			nums[i]=Character.getNumericValue(s.charAt(i));
			//System.out.println(i+":"+nums[i]);
			//counts[i]=nums[i];
			
			if(nums[i]!=1){
				non_one=i;
				break;
			}
			
		}
		if(K<=non_one){
			System.out.println(1);
		}else{
			System.out.println(nums[non_one]);
		}
		
		
		
	}
}