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= list(map(int,input().split(" ")))
li = []
for ipp in range(n):
    temp =[]
    temp = list(input())
    li.append(temp)
total = []
for i in range(m):
    ty = 0
    for j in range(n):
        if(li[j][i]=="#"):
            ty+=1
    tr = [0,0]
    if(i>0):
        tr = total[i-1]
    total.append([tr[0]+ty , tr[1]+n-ty])
dp = []
mi = min(x,m)
for i in range(mi):
    dp.append([total[i][0],total[i][1]])


#print(total)

if(mi<m):
    for i in range(mi , m):
        t1 = i+1-x
        t2 = i+1-y
        #print("t1 ",t1 , "  t2  ",t2 , "   i",i)
        min1 = 100000000000
        min2 = 100000000000
        if(t1<x-1):
            min2 = total[i][1]
            min1 = total[i][0]
        else: 
            if(t1>1):
                min1 = total[i][0] - total[t1-1][0] + dp[t1-1][1]
                min2 = total[i][1] - total[t1-1][1] + dp[t1-1][0]   
            else:  
                min1 = total[i][0]
                min2 = total[i][1]  
            for ji in range(t2,t1):
                #print(ji)
                if(ji<x-1):
                    continue
                q = 0
                w = 0
                if(ji>=1):
                    q = total[i][0] - total[ji-1][0] + dp[ji-1][1]
                    w = total[i][1] - total[ji-1][1] + dp[ji-1][0]
                else:
                    q = total[i][0]
                    w = total[i][1]
                    #print("heree")
                if(min1>q):
                    min1=q
                if(min2>w):
                    min2=w
                #print(q,"q  w",w , " j ",ji)
        dp.append([min1,min2])
        #print(dp)
#print("ans")
print(min(dp[m-1][0],dp[m-1][1]))