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

black_columns = [0] * (width + 1)
white_columns = [0] * (width + 1)

# Storing input into columns
for row in range(1, height + 1):
    line = sys.stdin.readline().rstrip()
    index = 1
    for char in line:
        if char == "#":
            black_columns[index] += 1
        else:
            white_columns[index] += 1
        index += 1


# CUMSUM JAJAJAJAJ
cumsum_black = [0]
cumsum_white = [0]

for i in range(width):
    cumsum_black.append(cumsum_black[i] + black_columns[i + 1])
    cumsum_white.append(cumsum_white[i] + white_columns[i + 1])


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

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

    for j in range(x, y + 1):
        this_index = (i - j)

        if this_index < 0:
            break

        this_value_black = dp_white[this_index] + (cumsum_black[i] - cumsum_black[this_index])
        this_value_white = dp_black[this_index] + (cumsum_white[i] - cumsum_white[this_index])

        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)

answer = min(dp_black[width], dp_white[width])
sys.stdout.write(str(answer) + "\n")
 		 	 	  		  	     	 		 	  				