N,K=map(int,input().split()) S=input() NOW=N-2 while True: while S[NOW]=="x": NOW-=1 if NOW>=K: NOW-=K+1 else: break if NOW<0: print(0) else: print(NOW+1)