You've got an *n* × *m* pixel picture. Each pixel can be white or black. Your task is to change the colors of as few pixels as possible to obtain a barcode picture.

A picture is a barcode if the following conditions are fulfilled: 
 -  All pixels in each column are of the same color. -  The width of each monochrome vertical line is at least *x* and at most *y* pixels. In other words, if we group all neighbouring columns of the pixels with equal color, the size of each group can not be less than *x* or greater than *y*.
The first line contains four space-separated integers *n*, *m*, *x* and *y* (1 ≤ *n*, *m*, *x*, *y* ≤ 1000; *x* ≤ *y*).

Then follow *n* lines, describing the original image. Each of these lines contains exactly *m* characters. Character "." represents a white pixel and "#" represents a black pixel. The picture description doesn't have any other characters besides "." and "#".
n , m , x , y=map(int,input().split())
l=[]
cnt =[]
for i in range(n):
    l1=input()
    l.append(l1)
for i in range(m):
    c=0
    for j in range(n):
        if l[j][i]=='.':
            c+=1 
    cnt.append(c)
prev =-1 
#prev=0 for . 
#prev=1 for #
#c1 for prev count 
#ans for ans
#col for col no
mn =10**9
def fnc(ans, cnt,prev ,c1,col):
    global mn
    if col==m:
        
        if c1>=x and c1<=y:
            mn =min(ans,mn)
        return
        
    if prev ==-1:
        fnc(ans+n-cnt[col],cnt ,0,1,col+1)
        fnc(ans+cnt[col],cnt,1,1,col+1)
    elif prev ==0:
        if c1<x:
            fnc(ans+n-cnt[col],cnt,0,c1+1,col+1)
        elif c1==y:
            fnc(ans+cnt[col],cnt,1,1,col+1)
        else:
            fnc(n-cnt[col]+ans,cnt ,0,c1+1,col+1)
            fnc(cnt[col]+ans,cnt,1,1,col+1)
    else:
        
        if c1<x:
            fnc(ans+cnt[col],cnt ,1,c1+1,col+1)
        elif c1>=y:
            fnc(n-cnt[col]+ans,cnt,0,1,col+1)
        else:
            fnc(cnt[col]+ans,cnt,1,c1+1,col+1)
            fnc(ans+n-cnt[col],cnt,1,1,col+1)
fnc(0,cnt ,-1,0,0,)
print(mn)
        
            
   
            
            
        
    