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())

# Read in the picture as a list of lists of 0's and 1's
picture = [[int(c == "#") for c in input()] for _ in range(n)]

# dp[i][j][k] is the minimum number of pixels to repaint to make the first i columns
# of the picture monochrome, with the i-th column having color k (0 for white, 1 for black),
# and the i-th monochrome group having j columns.
dp = [[[float("inf") for _ in range(2)] for _ in range(m + 1)] for _ in range(m + 1)]

# Initialize the dp array for the first column of the picture
for j in range(1, m + 1):
    dp[j][1][0] = sum(picture[i][j - 1] for i in range(n))
    dp[j][1][1] = n - dp[j][1][0]

# Fill in the rest of the dp array
for i in range(2, m + 1):
    for j in range(i, min(i + y, m) + 1):
        for k in range(2):
            # First, we compute the cost of making the i-th column the same color as the
            # (i - 1)-th column, and add this to the cost of the (i - 1)-th column's
            # monochrome group.
            cost_same = dp[i - 1][j - i + 1][k] + sum(picture[l][i - 1] != k for l in range(n))
            
            # Next, we compute the cost of making the i-th column a different color than
            # the (i - 1)-th column, and starting a new monochrome group.
            cost_diff = dp[i - 1][1][1 - k] + sum(picture[l][i - 1] != k for l in range(n))
            
            # Take the minimum of these two costs
            dp[j][j - i + 1][k] = min(cost_same, cost_diff)

# Output the minimum cost
print(min(dp[m][j][k] for j in range(x, y + 1) for k in range(2)))
