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 "#".
'''
# Submitted By M7moud Ala3rj
Don't Copy This Code, CopyRight . [email protected] © 2022-2023 :)
'''
# Problem Name = "Barcode"
# Class: C

import sys, threading

sys.setrecursionlimit(2147483647)
input = sys.stdin.readline
def print(*args, end='\n', sep=' ') -> None:
    sys.stdout.write(sep.join(map(str, args)) + end)

d = {}

def func(i=0, p="", r=0):
    global n, m, x, y, lst
    ans = d.get((i, p, r))
    if ans!=None:
        return ans
    if i==m: return 0
    hashes = lst[i]
    if p:
        if r<x:
            if p=="#":
                d[(i, p, r)] = func(i+1, "#", r+1)+(n-hashes)
                return d[(i, p, r)]
            d[(i, p, r)] = func(i+1, ".", r+1)+hashes
            return d[(i, p, r)]
        elif r==y:
            if p=="#":
                d[(i, p, r)] = func(i+1, ".", 1)+hashes
                return d[(i, p, r)]
            d[(i, p, r)] = func(i+1, "#", 1)+(n-hashes)
            return d[(i, p, r)]
        else:
            d[(i, p, r)] = min(func(i+1, "#", r+("#"==p))+(n-hashes), func(i+1, ".", r+("."==p))+hashes)
            return d[(i, p, r)]
    else:
        d[(i, p, r)] = min(func(i+1, "#", r+1)+(n-hashes), func(i+1, ".", r+1)+hashes)
        return d[(i, p, r)]

def Solve():
    global n, m, x, y, lst
    n, m, x, y = list(map(int, input().split()))
    lst = [0]*m
    for i in range(n):
        s = input().strip()
        for o in range(m):
            lst[o]+=s[o]=="#"
    
    print(func())
    


if __name__ == "__main__":
    threading.stack_size(10**8)
    threading.Thread(target=Solve).start()