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
import os.path
 
if(os.path.exists('input.txt')) :
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")
    sys.stderr = open("error.txt", "w")
    
depth = 1000000
mod = 1000000007 
lim = mod * mod
sys.setrecursionlimit(depth) 
 
linp = lambda: list(minp())
minp = lambda: map(int, input().split())
 
from math import inf, ceil, sqrt, log2, gcd
from collections import defaultdict, deque
 
dxy = [(1, 0),(-1, 0),(0, 1),(0, -1)]

def solve(idx, curr, color) :
    if idx == m : return 0
    if dp[(idx, curr, color)] != -1 : return dp[(idx, curr, color)]
    if curr < x :
        ans = solve(idx+1, curr+1, color) + cost[idx][1-color]
    elif curr < y :
        v1 = solve(idx+1, curr+1, color) + cost[idx][1-color]
        v2 = solve(idx+1, 1, 1-color) + cost[idx][color]
        ans = min(v1, v2) 
    else :
        ans = solve(idx+1, 1, 1-color) + cost[idx][color]
    dp[(idx, curr, color)] = ans
    return ans

n, m, x, y = minp()
mat, cost = list(), list()
for _ in range(n) :
    mat.append(input())
for j in range(m) :
    c = 0
    for i in range(n) :
        if mat[i][j] == "#" :
            c += 1
    cost.append((c, n-c))
dp = defaultdict(lambda: -1)
v1 = solve(0, 0, 0)
v2 = solve(0, 0, 1)
print(min(v1, v2))