import java.util.*;
public class Main {
        static Scanner sc = new Scanner(System.in);
        static void myout(Object t){System.out.println(t);}
        static void myerr(Object t){System.err.println(t);}
        static String getStr(){return sc.next();}
        static int getInt(){return sc.nextInt();}
        static Long getLong(){return sc.nextLong();}
        static boolean isNext(){return sc.hasNext();}
  		static String[] splitSingle(String str){return str.split("");}
        public static void main(String[] args){
          String[] s = splitSingle(getStr());
          long k = getLong();
          if(k > s.length){
            k = s.length;
          }
          String output = "1";
          for(int i = 0; i < k; i++){
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          }
          myout(output);
        }
        //便利メソッド追加枠ここから

        //便利メソッド追加枠ここまで
} import java.util.*; util.* java public class Main {
        static Scanner sc = new Scanner(System.in);
        static void myout(Object t){System.out.println(t);}
        static void myerr(Object t){System.err.println(t);}
        static String getStr(){return sc.next();}
        static int getInt(){return sc.nextInt();}
        static Long getLong(){return sc.nextLong();}
        static boolean isNext(){return sc.hasNext();}
  		static String[] splitSingle(String str){return str.split("");}
        public static void main(String[] args){
          String[] s = splitSingle(getStr());
          long k = getLong();
          if(k > s.length){
            k = s.length;
          }
          String output = "1";
          for(int i = 0; i < k; i++){
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          }
          myout(output);
        }
        //便利メソッド追加枠ここから

        //便利メソッド追加枠ここまで
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static void myout(Object t){System.out.println(t);} myout {System.out.println(t);} System.out.println(t) System.out.println System.out System System.out t Object t t static void myerr(Object t){System.err.println(t);} myerr {System.err.println(t);} System.err.println(t) System.err.println System.err System System.err t Object t t static String getStr(){return sc.next();} getStr {return sc.next();} return sc.next(); sc.next() sc.next sc static int getInt(){return sc.nextInt();} getInt {return sc.nextInt();} return sc.nextInt(); sc.nextInt() sc.nextInt sc static Long getLong(){return sc.nextLong();} getLong {return sc.nextLong();} return sc.nextLong(); sc.nextLong() sc.nextLong sc static boolean isNext(){return sc.hasNext();} isNext {return sc.hasNext();} return sc.hasNext(); sc.hasNext() sc.hasNext sc static String[] splitSingle(String str){return str.split("");} splitSingle {return str.split("");} return str.split(""); str.split("") str.split str "" String str str public static void main(String[] args){
          String[] s = splitSingle(getStr());
          long k = getLong();
          if(k > s.length){
            k = s.length;
          }
          String output = "1";
          for(int i = 0; i < k; i++){
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          }
          myout(output);
        } main {
          String[] s = splitSingle(getStr());
          long k = getLong();
          if(k > s.length){
            k = s.length;
          }
          String output = "1";
          for(int i = 0; i < k; i++){
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          }
          myout(output);
        } String[] s = splitSingle(getStr()); s splitSingle(getStr()) splitSingle getStr() getStr long k = getLong(); k getLong() getLong if(k > s.length){
            k = s.length;
          } k > s.length k s.length s s.length {
            k = s.length;
          } k = s.length k s.length s s.length String output = "1"; output "1" for(int i = 0; i < k; i++){
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          } {
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          } String tmp = s[i]; tmp s[i] s i if(!tmp.equals("1")){
              output = s[i];
              break;
            } !tmp.equals("1") tmp.equals("1") tmp.equals tmp "1" {
              output = s[i];
              break;
            } output = s[i] output s[i] s i break; myout(output) myout output String[] args args public class Main {
        static Scanner sc = new Scanner(System.in);
        static void myout(Object t){System.out.println(t);}
        static void myerr(Object t){System.err.println(t);}
        static String getStr(){return sc.next();}
        static int getInt(){return sc.nextInt();}
        static Long getLong(){return sc.nextLong();}
        static boolean isNext(){return sc.hasNext();}
  		static String[] splitSingle(String str){return str.split("");}
        public static void main(String[] args){
          String[] s = splitSingle(getStr());
          long k = getLong();
          if(k > s.length){
            k = s.length;
          }
          String output = "1";
          for(int i = 0; i < k; i++){
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          }
          myout(output);
        }
        //便利メソッド追加枠ここから

        //便利メソッド追加枠ここまで
} public class Main {
        static Scanner sc = new Scanner(System.in);
        static void myout(Object t){System.out.println(t);}
        static void myerr(Object t){System.err.println(t);}
        static String getStr(){return sc.next();}
        static int getInt(){return sc.nextInt();}
        static Long getLong(){return sc.nextLong();}
        static boolean isNext(){return sc.hasNext();}
  		static String[] splitSingle(String str){return str.split("");}
        public static void main(String[] args){
          String[] s = splitSingle(getStr());
          long k = getLong();
          if(k > s.length){
            k = s.length;
          }
          String output = "1";
          for(int i = 0; i < k; i++){
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          }
          myout(output);
        }
        //便利メソッド追加枠ここから

        //便利メソッド追加枠ここまで
} Main
import java.util.*;
public class Main {
        static Scanner sc = new Scanner(System.in);
        static void myout(Object t){System.out.println(t);}
        static void myerr(Object t){System.err.println(t);}
        static String getStr(){return sc.next();}
        static int getInt(){return sc.nextInt();}
        static Long getLong(){return sc.nextLong();}
        static boolean isNext(){return sc.hasNext();}
  		static String[] splitSingle(String str){return str.split("");}
        public static void main(String[] args){
          String[] s = splitSingle(getStr());
          long k = getLong();
          if(k > s.length){
            k = s.length;
          }
          String output = "1";
          for(int i = 0; i < k; i++){
            String tmp = s[i];
            if(!tmp.equals("1")){
              output = s[i];
              break;
            }
          }
          myout(output);
        }
        //便利メソッド追加枠ここから

        //便利メソッド追加枠ここまで
}
