import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		long k = sc.nextLong();
		
		// 計算
		int result = 1;
		for(int i = 0; i < s.length(); i++){
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		}
		
		// 出力
		System.out.println(result);
	}
} import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; import java.math.BigInteger; BigInteger java.math public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		long k = sc.nextLong();
		
		// 計算
		int result = 1;
		for(int i = 0; i < s.length(); i++){
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		}
		
		// 出力
		System.out.println(result);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		long k = sc.nextLong();
		
		// 計算
		int result = 1;
		for(int i = 0; i < s.length(); i++){
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		}
		
		// 出力
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		long k = sc.nextLong();
		
		// 計算
		int result = 1;
		for(int i = 0; i < s.length(); i++){
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		}
		
		// 出力
		System.out.println(result);
	} 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 int result = 1; result 1 for(int i = 0; i < s.length(); i++){
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		} {
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		} int m = s.charAt(i) - '0'; m s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' if(m != 1){
		        result = m;
		        break;
		    } m != 1 m 1 {
		        result = m;
		        break;
		    } result = m result m break; k-- k if(k == 0) break; k == 0 k 0 break; System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		long k = sc.nextLong();
		
		// 計算
		int result = 1;
		for(int i = 0; i < s.length(); i++){
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		}
		
		// 出力
		System.out.println(result);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		long k = sc.nextLong();
		
		// 計算
		int result = 1;
		for(int i = 0; i < s.length(); i++){
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		}
		
		// 出力
		System.out.println(result);
	}
} Main
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		long k = sc.nextLong();
		
		// 計算
		int result = 1;
		for(int i = 0; i < s.length(); i++){
		    int m = s.charAt(i) - '0';
		    if(m != 1){
		        result = m;
		        break;
		    }
		    k--;
		    if(k == 0) break;
		}
		
		// 出力
		System.out.println(result);
	}
}
