/*
:    .                                                                                                                  
:                                                                                                                       
i                                                                                                                       
i    .                                                                                                                  
i                                                                                                                       
:    .                                                                                                                  
i    .                                                                                                                  
i    .                                                                                                                  
i                                                                                                                       
:        .                                                                                                              
i  .  i  i :     . .    .   .     .       . .           ..    .                                   .          .          
.     .  . .       .                      .   .      .                                                          .       
:   qQ  .   v2d   .  i: ..:ij.iBE .i            EBj        .irrivri.::iiiir7r.                       .    SPd.  :       
i  UQB    .BBBBE     BBBQBBBBLiBB.1BBi    :X:   BBu    .   .KBBBBBBBBBBBBBBBQv                          :BBBBB          
. iBY PD. BBY vBBv.  ..:gB1   rBM  7B1    RQP   MBgvPPQBB          uRq.        ..                 .    jBBQ.BBBr        
:.BBrQBBBBBL   iQBB7:777gBSYvrKBBv:v71r..YPBBBBBBBBBBEBBB    7RBZQdBBBdEgBQE                         1QBB1   QBBB:      
.:BBBBJ.qBBDBBBBBBBvrQBQBBBBBBBBBBBBBgg5UBBBBriiBQ1   rBB  .:.:i. :KQBi ..::    :.. . . .   .....  UBBB5  UJ: rBBBBXi   
.  IQY     i:.:..       YBs   :BB   IE.   XBZ   QBs   7BB  rBBBBQBBBBBBBQBBBBq BQBBBBBBBBBBBBBBBBviBBE.  .BBZ   .BBgi.  
. BBBQSJ.Kb5BQgRBPv :5gQBBBQBB:YBvrBBd    QBE   BBdiBBBB5      .BB     uBs     iririiiriir7iii77i. ii    .BBD  .        
. uQ5Sv .BB::i::QBU  BBQMBK.   7BBBP.     DBq   QB1 DQ7.L. sBBdQBBMBBBQBBBBBQDi                           BB5           
.    ...:BB     KBJ     uB1   UBBBL  QBL  RQb   i:.     BBPvi.UBBuY7v7iQBqrrur.                           BBE   .       
:LBBBBBBJQBBBBQBBBJ  :rvBBu:BBB1jBBPbBB   SBBZIvSUguJXRBBB:  7QBB      BBu     ..                         BBQ           
r.XX... .QBIYXDJBB1  qBBBBi ir   rMQBQ.   .sPBBBBBBBBRBBD7  XBBi       dB1. .  ..                        .BBg           
i                .                   .                           . . .         ..                         ... .         
:                                                                                                                       
i    .                                                                   .                                              
i                                                                                                                       
i    .                                                                                                                  
i                                                                         :r:.                                          
i    .                                                                .  vKKSj. .                                       
r                                                                 ..    :B: js  .                                       
i    .                                                             .    rK .S:                 :::                      
r                                                                       :v LS             .  ibi7gv   .                 
i                                                                       :Ligi               .QJ :g7  .                  
.      ...5d:  .                                                        i2Sd               rb. vj:      .               
.   .7:r27DBi                                                      .    .Bb:     .        7K..Ps                        
uij1Pdr.  ri                                                       .     Sq              :Kj7Ii .  .     :v:            
UvY:     7P. .                                                     .     .7             .vIqX. ..  .    .dBRS7.         
.    .   qP     . .       .  ..                                       .     .  ..        :r.            .qi :2ZPi       
.    .   gs     .    .:K2  .          .irvIs75K5XEKMKgZsD522YLri.              iBB1i                     Pr   .2r       
i       iS:        .isjjQ.    .:rs5KPPMBBBZdBBgi:7Rd7XBBBRSMBBDZQZSr.        rDYiiYdQSr.                 dY             
:       Ys      .iXbi.  7: 7v5gQZqPEKXUIjUIdbr   ur    jRQr1E:  .rJgBBDL:   iEv     .sdD5Yi.             MX  .   .      
i       Si   .vU57i   .ibQBBgMPI175XUvsq5LBj   :Li.     jQLJ:  .    .rdBBQsYL           :r1ISv:         .gu    .        
:   .. iU  r5Qu.   :sBBD7qDqbbijPj5ISXv22UK   .BY .     .gSP: .q:      rBBBBS    .   .      .7KEYi.      qv    .        
.      qBsY1i   :IqBZqI2rUXLXQPrYjIuED2jZPv.  KI .  .    .BR. rd        .bBUBQu.          .    .isZK1:   5s             
:      vPv.  .idDBEP1XYKXQR1r5d2SdPqEDv7IEY  Yv    .      KB.:U.  :Ui    .BJUBBB1        .         rXqIrrB2    .        
v           rQDM1dj7SM1qIuPgXJKS2sKU5urLDMr :Bi   .  .dBMi7BPYJ 1PKL:     BjKIUPBB1       .       .   :irMX             
i  .     .vKDDr1YREIPgv1qS1Qbju1IS2US5vUZBu sr .    :BBBBdXMDMgjv.   :    guJsP7rQgU:                    JdrsSv:        
7       rQREJ5u2vuKv5dXKKPXqqXK1PSSqP2USqqBDj    .  7QBQRPQriQg:..v7i:.   MqEXBs72DQB:              .iYYr..iPRJ         
7  .  .MRB221QqKrYSSXdXXuBZuSguL1sPMDQQDPPgBi    .  :RBBMB5  PELBBBj     vP.  irRBgRPEv           .Ju7ivv7vLi.   .      
:    7DQUdSPqgIqUsKSYv5Si2PrruJSBZR5r::   :Z:        .irvX::qPPZMBBQgs  .Xs      LPuXBBi         :Dd2rLsr.      .       
i   YBZ7Lg2bUPLb172Xr7PQvJuuuMBbX7.       .uRu.         :QEBQRRBZgggQBSrY.         :SQQX         :27:.       .          
i .EP2PX1qJYIPuu5I2g2uB5YXbDZPJ   .rr.  .   7gZU7r7vYvvvJqBQRBMdgDMgBQQr            r5BBr                               
 .gB2LgEsPPuKE2IrM5Iu1U2JXgS.     :7vvvsYLL7. .rs77JJr.  JBQDBbdEZBRgBP      . .YIUvirvBQ:   .                          
XQQSqgDJ7qg5bPXqLd1bQ2JQB2.              ..:7Lv7:        iBQSREEBQQRBP:     iSPL7.     rBu                              
QgUjEE2qJbKsjX2duqYKr5BS.      ..             .rYr.       dBQBZBQBKgM. .  rZ2:          jEi                             
vJdPIJI5UPSYKb5uLbLSDEu       .                            :BBgBPEBr  .  ....         . iBK.                            
YvLb7K5L7ubsjgJuuSsPQ7  .....:iiirr77v7vrv1PXU77rr::.            :E.  .           .. ..  sgi                            
LuKQrsSd5XQPqSij7bBu    :ivu5J7i::::::::::i::.::iri..            :Ei.     ..i715qLPdUqS. iBi     .                      
7UPBv2IPqP1IdXLZZPr   .                                .         .sY       .ir:.     ..  .QE  ..                        
UsJRubSv7ggUJr1Qg:                             ..                 r5                      vd.                           
d5YPrSqX7QIvPRBX.  .  .            ..:i777r7vJvr:      .         .rZ  .                 .iE5rr                          
2LKXj2E17DjSMSQi          ..ii7uqS522J7:.....              ..     7Z.    .  .75Y::.  7KdBZEXXBQ:                        
r7PQqdEjJEPJuZJ       iIPK1j7:.:.         .:i:......              :P        .iLuvPSsXQbr     .JBP                       
sLPP1uqs2XR7JQ:       .:i.        .:71ZBBBQEDDMbdMBBBdui:         rZ.               .          bB.                      
UUqK7vSIv5PuDg                .YdQBBBBQBMESJ777s1bPdEgRQBBRUi.    .5       .                  .gq                       
vLZPvvbKLdSIBv          .   1MBRQBBBMEbZPvgBRJrLY7Uj2J7rvPDQBBgUY722            ...       ..  iBJ                       
irIKvUPI7M1SRi     .  .   7BB1JUvSd1Y512IYSBMKLPv1XirsivvUKgDgBBBBBBKr:.                  ..  uE.                       
D2KIJ5D17EPdd.  .        qBJv.ivivYi7JvrLrLEgbbP1PE:71sS5sDq7vDQD2qbgBBBMJi                  rR7                        
vJPbvJq2YgEQ2           .BP.L7ijIEuiivr7vii1PKgg5dRjXgUSujJ7JgJ7Piru1UKMBBQM2i             .2I:.                        
vrXP1Xg2vJjbL    .  .   sBBuXI1gBgE2SI7vIrrsIiSISdBSEZ1bggQv7Es:U77YLirugggDBBBgKUJrri:.:7IEP.                          
XU1UubPuLu7LY    .     :5RBgUBBPPdggBEUdqIKXviuJrYdPPq2PKKBqY1jrj75I1LL7UXZBBdPEQBP7jIIdKSBB.  .                        
sIDbX5X5KRBSE         .ZXLXI7q57UJ5IRUUZP5KZguivSv1S55bS12BMBjJ7dXBgZIqr7dqMEPBEQQ:       KB7         ...       ..      
PU7v5MPJ7KZPD         iBbU7v77:r7irYdIud5KqZPsrs2vYUsJuPP5SLKgQdEEgdPgMX7qvI5DXbMX       :BQ                            
511sSdZXI51vg.     .  LgXgU77iir5dddBMMBBBP5dP52S2gBQ2vL22RdBQBPQP15SdMR1Jivrr:MBr       SBv   .jDBMbuv:      ..        
vU52sujjUEq1E.   . .  2MrBDU5PQBZP7.:..irDQQPdBBRqi.      .:jXQMBPrIjXXBP1iuii.BE       .BX  rSQK:...i1dX7.             
KJ1svuqsrEgPK      .  v1rDQDBj:.          .LQBS.              .JBE.r7555RbbK55PBr    .  Kg  7QM.        7BBv            
PXdEu5PsLKv5di        7E1dKi                :J.                 :gg1iq1LsQRRYuBP   .r  KQi iBg           .2Q5.  .       
IjPP1ID5UJYdBY        rBBS    .                 .                :BErj7YU5ZPdBZ       vBv :Rd              IBi          
2UKK7JPXuIgQBb    .    bBi     .         .   .           .        EBPYv7srIKBB       vBr  sBi    .         .B1          
vvbb15d5bSPLPB:   .    rB:    ..          .                       :qBKQvYLJRK       iQ2 :ZBBr   .           Rv .        
SY57vDIKZLuuKBi        .BB.    .   .                             . bBXgudD5v      .2BBgqqbgBJ   .    ...   .E5          
v75vYqPPq5KPjJE:  .     iBBr    .                                 .BMvBQEv:       BBq1EsSQS5Bi  .   .      :BL          
vUUs7YuJrXJd7:BP     .   .PQqv:                          ..  .:77juBQJsi        rBQYiJU1JX5PRb:           vBL    .      
dZsY55RS1qjdqrBBL          .JPMRP77.   .:.....:.:i7vjuSqEEbXqqquL7. .         .jBQJvdR5vuuuJ5BBq:       isBB  . .       
BQ7v1KDu5qYSqsJgQ:             .r7IEPUs11uj25X21JJri::...                    7QB1rPQY2duIQKXZJ7BBdu7:isDZ5:    ..       
LYRgsvSUPqX1UUI2Bd.                                                       ii2MEgI7dRSJ1sSBX7SPXsPZBBXr77.               
 vBB1PBZMQggZDZMXgBBDgMRbbEQQRZPZRPKSPbDRBDKujsuYv25Ys2qSEPDMMddZgZMQBBBgQBQEPsqXJSqsIP52M5UPPsvERZi                    
s5QgPQBIDMMDgDgDgBBgEBBBBBBQQBBBBQBBBBBQQBBBBBBBBQBBBBBQBBBBBBBBBQBBBBBBBMBQgESDDSEKUPgU2qSqUrPBBv.   .                 
rrPBBgMDMQRRMQgQDMQBQBMgRQggDgRBBBgZgBBBQBBBBBBBBBBBBBS:     ..vbBBBQBQMbSQQMEYSuLI5uPKv1D77PBBXi      ...              
i LdMdKKqqPgZSgd1PZPSLXPXSZZXPZIQZJ5EKdDgMMdqYr.::.:bB:          LBXIQBKPgBquP2PZuUuUSXj5ZqXBB7                         
i:BP2j:vYs7q5sZI:2uvv7Ss7UYKs51r51rJLjDg7:          .BvPPgX1vrii:2Qi  vBbIMQuZrsDP55uu2XYdBQU:   .                      
rPBLJ27PXu7SP2QIvSJsPKgYPPisXq1Lg51ZBdr             2Q: .. .qBU.:vbv.  :IQBqiSs2KYLudKv7QQb.                            
BBXr7P1PXXsPSjD5757YPPE1JJiXPZj7sSQK:                1v     iBu   g7 .   iDBPQsIPuIP7vZB1.                       .      
MuiK7uKKj11Pj:S1UbuJXv2JJSKKLU2rSgX  .....:::...::.: .Bd..i.:bj .SB7 .::  KBgMv1gu2KqDBZ:  .:ii:ri::iiirrrviii7i.        
*/



#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<time.h>
#include<cstdlib>
#include<cmath>
#include<list>
using namespace std;
#define MAXN 10000006
#define eps 0
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Fore(i,a,b) for(int i=a;i>=b;i--)
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define mkp make_pair
#define pb push_back
#define cr clear()
#define sz size()
#define met(a,b) memset(a,b,sizeof(a))
#define iossy ios::sync_with_stdio(false)
#define fr freopen
#define pi acos(-1.0)
#define Vector Point
#define fir first
#define sec second
#define it_s_too_hard main
const long long inf=1LL<<62;
const int iinf=1<<30;
const double dinf=1e17;
const int Mod=1e9+7;
typedef long long ll;
typedef long double ld;
const int MAXBUF = 10000;
char buf[MAXBUF], *ps = buf, *pe = buf+1;
bool isdigit(char n) {
    if (n >= '0' && n <= '9') return true;
    return false;
}
inline void rnext(){
    if(++ps == pe)
        pe = (ps = buf)+fread(buf,sizeof(char),sizeof(buf)/sizeof(char),stdin);
}
template <class T>
inline bool in(T &ans){
    ans = 0;
    T f = 1;
    if(ps == pe) return false;//EOF
    do{
        rnext();
        if('-' == *ps) f = -1;
    }while(!isdigit(*ps) && ps != pe);
    if(ps == pe) return false;//EOF
    do{
        ans = (ans<<1)+(ans<<3)+*ps-48;
        rnext();
    }while(isdigit(*ps) && ps != pe);
    ans *= f;
    return true;
}
const int  MAXOUT=10000;
char bufout[MAXOUT], outtmp[50],*pout = bufout, *pend = bufout+MAXOUT;
inline void write(){
    fwrite(bufout,sizeof(char),pout-bufout,stdout);
    pout = bufout;
}
inline void out_char(char c){ *(pout++) = c;if(pout == pend) write();}
inline void out_str(char *s){
    while(*s){
        *(pout++) = *(s++);
        if(pout == pend) write();
    }
}
template <class T>
inline void out_int(T x) {
    if(!x){
        out_char('0');
        return;
    }
    if(x < 0) x = -x,out_char('-');
    int len = 0;
    while(x){
        outtmp[len++] = x%10+48;
        x /= 10;
    }
    outtmp[len] = 0;
    for(int i = 0, j = len-1; i < j; i++,j--) swap(outtmp[i],outtmp[j]);
    out_str(outtmp);
}
inline ll lowbit(ll x){
    return x&(-x);
}
int dcmp(ld x){
    if(fabs(x)<=eps) return 0;
    return x<0?-1:1;
}
struct Point{
	ll x,y;
	Point(ll x=0,ll y=0):x(x),y(y) {}
	Point operator - (const Point &a)const {return Point(x-a.x,y-a.y);}
	Point operator + (const Point &a)const {return Point(x+a.x,y+a.y);}
	bool operator == (const Point &a)const {return x==a.x&&y==a.y;}
	bool operator <  (const Point &a)const {if(x==a.x) return y<a.y;return x<a.x;}
};
ll Cross(Vector a,Vector b){ return a.x*b.y-a.y*b.x;}
ll Dot(Vector a,Vector b){ return a.x*b.x+a.y*b.y;}
bool on_seg(Point p,Point a,Point b){
	if(a==p || b==p) return 1;
	return Cross(p-a,b-a)==0 && Dot(p-a,b-a)>0;
}
bool Insect(Point p1,Point p2,Point p3,Point p4){
	if(on_seg(p1,p3,p4)|| on_seg(p2,p3,p4) || on_seg(p3,p1,p2) || on_seg(p4,p1,p2)) return 1;
	ll c1=Cross(p2-p1,p3-p1),c2=Cross(p2-p1,p4-p1);
	ll c3=Cross(p4-p3,p2-p3),c4=Cross(p4-p3,p1-p3);
	return c1*c2<0 && c3*c4<0;
}
int ConvexHull(Point *p,int n,Point *ch){
	int m=0;
	sort(p+1,p+1+n);
	For(i,1,n){
		while(m>1 && Cross(ch[m-1]-ch[m-2],p[i]-ch[m-2])<=0) m--;
		ch[m++]=p[i];
	}
	int k=m;
	Fore(i,n,1){
		while(m>k && Cross(ch[m-1]-ch[m-2],p[i]-ch[m-2])<=0) m--;
		ch[m++]=p[i];
	}
	if(n>1) m--;
	return m;
}
ll k;
char s[100];
void I_can_t_solve_it(){
	cin>>s;
	cin>>k;
	int l=strlen(s);
	For(i,0,l-1) {
		if(s[i]=='1') {
			k--;
			if(k==0) {cout<<1<<endl;return ;}
		}else {
			cout<<s[i]<<endl;return ;
		}
	}
}
int it_s_too_hard(){
	int t=1;
	iossy;
	For(i,1,t){
		I_can_t_solve_it();
	}
	return 0;
}


Measured memory_bytes: 256