Guest User

Untitled

a guest
Jan 26th, 2015
224
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. P,K,L=map(int,input().split())
  2. Q=list(input())
  3. l=[(L,0)]*K
  4. for i in range(K):
  5.      for j in range(len(Q)-L):
  6.           if Q[j:j+L].count('#')<l[i][0]:
  7.               l[i]=Q[j:j+L].count('#'),j
  8.      del Q[l[i][1]:l[i][1]+L]
  9. print(sum([x[0]for x in l]))
RAW Paste Data