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
from math import log2,floor,ceil,sqrt,gcd
import bisect
# from collections import deque
sys.setrecursionlimit(10**5)

Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD =  1000000007

# for _ in range(int(ri())):
n,m,x,y = Ri()
lis = []
for i in range(n):
    temp = ri()
    lis.append(temp)
black = [0]*m
white = [0]*m
preb = [0]*(m+1)
prew = [0]*(m+1)
for j in range(m):
    cnt = 0
    for i in range(n):  
        if lis[i][j] == '#':
            cnt+=1
    black[j] = cnt
    white[j] = n-cnt
    preb[j+1] = preb[j]+black[j]
    prew[j+1] = prew[j]+white[j]

dp = list2d(2,m+1,INF)
dp[0][0] = dp[1][0] = 0
for i in range(m):
    for j in range(max(i-x-1,0),max(i-y-2,-1),-1):
        dp[0][i+1] = min(dp[0][i+1],prew[i+1]-prew[j]+dp[1][j])
        dp[1][i+1] = min(dp[1][i+1],preb[i+1]-preb[j]+dp[0][j])

print(min(dp[0][m],dp[1][m]))