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(x) for x in input().split()]
col_blacks = [0]*m
for i in range(n):
	cur_str = input()
	for j, cur_ch in enumerate(cur_str):
		if cur_ch == '#':
			col_blacks[j] += 1
# print(col_blacks)

def get_min_pixels(pos, color, memory={}):
	# print(f'pos {pos}, color {color}')
	# assume a column starts from pos and its size may be from x to y
	# returns min pixels to repain of matrix suffix starting from this col
	# memory holds (pos, color) -> required_min

	if color == 'white':
		costs = col_blacks
	else:
		costs = [n-col_black for col_black in col_blacks]

	# if pos == m-1:
		# return 0
	if pos < m-1 and pos+x > m-1:
		return 2*n*m
	cur_max_size = min(y, m-pos)
	# print(f'cur_max_size {cur_max_size}')
	cumsums = []
	# print(f'costs {costs}')
	for cost in costs[pos+x-1 : pos+cur_max_size]:
		if len(cumsums) == 0:
			cumsums.append(cost)
		else:
			cumsums.append(cost+cumsums[-1])
	# print(f'cumsums {cumsums}')  # test
	if len(cumsums) == 0:
		return 0

	overall_min = n*m
	next_color = 'white' if color=='black' else 'black'
	for size in range(x, cur_max_size+1):
		cur_min = cumsums[size-x] + get_min_pixels(pos+size, next_color, memory)
		overall_min = min(overall_min, cur_min)
		# process end of matrix
	memory[(pos, color)] = overall_min
	return overall_min

memory = {}
black_min = get_min_pixels(0, 'black', memory)
# print(memory)
white_min = get_min_pixels(0, 'white', memory)
# print(f'black_min {black_min}')
# print(f'white_min {white_min}')
print(min(black_min, white_min))
