import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String N = sc.next();
   long K = sc.nextLong();
   int tmp =0;
   char tmpchar = '1';
   
   while(101>tmp && K>tmp)
   {
     if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     }
     tmp++;
   }
   
   System.out.println(tmpchar);
 }
} import java.util.*; util.* java public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String N = sc.next();
   long K = sc.nextLong();
   int tmp =0;
   char tmpchar = '1';
   
   while(101>tmp && K>tmp)
   {
     if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     }
     tmp++;
   }
   
   System.out.println(tmpchar);
 }
} Main public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String N = sc.next();
   long K = sc.nextLong();
   int tmp =0;
   char tmpchar = '1';
   
   while(101>tmp && K>tmp)
   {
     if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     }
     tmp++;
   }
   
   System.out.println(tmpchar);
 } main {
   Scanner sc = new Scanner(System.in);
   String N = sc.next();
   long K = sc.nextLong();
   int tmp =0;
   char tmpchar = '1';
   
   while(101>tmp && K>tmp)
   {
     if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     }
     tmp++;
   }
   
   System.out.println(tmpchar);
 } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String N = sc.next(); N sc.next() sc.next sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc int tmp =0; tmp 0 char tmpchar = '1'; tmpchar '1' while(101>tmp && K>tmp)
   {
     if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     }
     tmp++;
   } 101>tmp && K>tmp 101>tmp 101 tmp K>tmp K tmp {
     if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     }
     tmp++;
   } if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     } N.charAt(tmp)!='1' N.charAt(tmp) N.charAt N tmp '1' {
       tmpchar = N.charAt(tmp);
       break;
     } tmpchar = N.charAt(tmp) tmpchar N.charAt(tmp) N.charAt N tmp break; tmp++ tmp System.out.println(tmpchar) System.out.println System.out System System.out tmpchar String[] args args public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String N = sc.next();
   long K = sc.nextLong();
   int tmp =0;
   char tmpchar = '1';
   
   while(101>tmp && K>tmp)
   {
     if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     }
     tmp++;
   }
   
   System.out.println(tmpchar);
 }
} public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String N = sc.next();
   long K = sc.nextLong();
   int tmp =0;
   char tmpchar = '1';
   
   while(101>tmp && K>tmp)
   {
     if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     }
     tmp++;
   }
   
   System.out.println(tmpchar);
 }
} Main
import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String N = sc.next();
   long K = sc.nextLong();
   int tmp =0;
   char tmpchar = '1';
   
   while(101>tmp && K>tmp)
   {
     if(N.charAt(tmp)!='1')
     {
       tmpchar = N.charAt(tmp);
       break;
     }
     tmp++;
   }
   
   System.out.println(tmpchar);
 }
}