import java.util.Scanner; public class Main { public static void main(String[] a) { Scanner s=new Scanner(System.in); s.nextInt(); int K=s.nextInt()-1,i,D,L=1; String P=s.next(); D=81-2*P.charAt(K); for(i=K+D;0!=(L+=D*(81-2*P.charAt(i)));i+=D); System.out.println(i+1); } }