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, widthMin, widthMax = map(int, input().split())


def getMin(colIdx, currentWidth, code):
    if colIdx == len(matrix[0]):
        if currentWidth > widthMax or currentWidth < widthMin:
            return float('inf')
        return 0
    if (colIdx, currentWidth, code) in cache:
        return cache[(colIdx, currentWidth, code)]

    dots = float('inf')
    hashes = float('inf')
    if(colIdx == 0 or (code == 0 and currentWidth + 1 <= widthMax) or (code == 1 and currentWidth >= widthMin)):
        dots = anotherCache[(colIdx, 0)] + getMin(colIdx + 1,
                                                  currentWidth + 1 if code == 0 else 1, 0)

    if(colIdx == 0 or (code == 1 and currentWidth + 1 <= widthMax) or (code == 0 and currentWidth >= widthMin)):
        hashes = anotherCache[(colIdx, 1)] + getMin(colIdx + 1,
                                                    currentWidth + 1 if code == 1 else 1, 1)

    cache[(colIdx, currentWidth, code)] = min(dots, hashes)
    return min(dots, hashes)


matrix = []
for i in range(n):
    currentInput = input()
    matrix.append(currentInput)

anotherCache = {}
for i in range(m):
    dots = 0
    hashes = 0
    for x in range(len(matrix)):
        if matrix[x][i] == ".":
            dots += 1
        else:
            hashes += 1
    anotherCache[(i, 0)] = dots
    anotherCache[(i, 1)] = hashes
cache = {}
currentMin = getMin(0, 0, 2)
print(currentMin)
