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 "#".
# eric_kirch
# Tarea 3 Ejercicio 5
# E - Supermercado Lidor

# column -> (hashes (black), dots (white))
# because column(# . # # .) == column(# # # . .)
# (as far as operations it can handle goes)

import sys

# Input
line = sys.stdin.readline()
height, width, x, y = [int(x) for x in line.split()]
# n is height, m is width

columns = [[0, 0] for i in range(width)]

# Storing input into columns
for row in range(height):
    line = sys.stdin.readline().rstrip()

    index = 0
    for char in line:
        if char == "#":
            columns[index][0] += 1
        else:
            columns[index][1] += 1

        index += 1


# Processing
dp_black = [columns[0][1]]
dp_white = [columns[0][0]]

for i in range(1, width):
    current_min_black_value = 2147483647
    current_min_white_value = 2147483647

    for j in range(x, y + 1):  # maybe not +1
        if i - j < 0:
            continue

        this_index = (i - j)

        this_value_black = dp_white[this_index] + columns[this_index + 1][1]
        this_value_white = dp_black[this_index] + columns[this_index + 1][0]

        if this_value_black < current_min_black_value:
            current_min_black_value = this_value_black

        if this_value_white < current_min_white_value:
            current_min_white_value = this_value_white

    dp_black.append(current_min_black_value)
    dp_white.append(current_min_white_value)

print(max(dp_black[width - 1], dp_white[width - 1]))

 		 		 		  	     		  	 	     		