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 "#".
import sys
n,m,x,y=list(map(int,input().split()))
lis1=[0]*m
lis2=[0]*m
for i in range(n):
    s=str(input())
    for j in range(m):
        if s[j]=="#":
            lis1[j]+=1
        else:
            lis2[j]+=1
num1=[0]
num2=[0]
for i in range(m):
    num1.append(num1[-1]+lis1[i])
    num2.append(num2[-1]+lis2[i])
dp=[[0]*(m+1) for i in range(2)]
for i in range(1,m+1):
    ans1=sys.maxsize
    ans2=sys.maxsize
    for j in range(x,y+1):
        if i-j>=0:
            temp1=dp[1][i-j]+num1[i]-num1[i-j]
            temp2=dp[0][i-j]+num2[i]-num2[i-j]
            ans1=min(ans1,temp1)
            ans2=min(ans2,temp2)
    dp[0][i]=ans1
    dp[1][i]=ans2
print(min(dp[0][m],dp[1][m]))


            

