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 = [int(t) for t in input().split()]
matrix = []
CostN =[0] * m
costB =[0] * m 
for i in range(n):
	aux = input()
	for i in range(m):
		if aux[i] == ".":
			costB[i] += 1
		else:
			CostN[i] += 1
for i in range(m):
	matrix.append([-1, -1])

costos = [CostN, costB]
def dp(columna, opcion, cont):
	if columna == m-1:
		matrix[columna][opcion] = costos[opcion][columna]
		return costos[opcion][columna]
	if matrix[columna][opcion] != -1:
		return matrix[columna][opcion]
	if cont < x:
		if x - cont > m -columna:
			return 10**17
		matrix[columna][opcion] =  dp(columna+1, opcion, cont +1) + costos[opcion][columna]
		return matrix[columna][opcion]
	elif x <= cont < y:
		a = dp(columna+1, opcion, cont +1) + costos[opcion][columna]
		b = dp(columna+1, 1-opcion, 1) + costos[opcion][columna]
		matrix[columna][opcion] = min(a,b)
		return matrix[columna][opcion]
	elif cont == y:
		matrix[columna][opcion] = dp(columna+1, 1-opcion, 1) + costos[opcion][columna]
		return matrix[columna][opcion]
	else:
		return 10**17


a = dp(0,0,1)
matrix = []
for i in range(m):
	matrix.append([-1, -1])
b = dp(0,1,1)
print(min([a,b]))
# 1500677268764
