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 "#".
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll N = int(1e7 + 10);
vector<string> l;
ll zb[1003], zw[1003];
ll dp[1003][2];
int main()
{
	IOS;
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	freopen("output.out", "w", stdout);
#endif
	ll n, m, x, y;
	cin >> n >> m >> x >> y;
	for (ll i = 0; i < n; i++) {
		string s;
		cin >> s;
		l.push_back(s);
	}
	for (ll j = 0; j < m; j++) {
		for (ll i = 0; i < n; i++) {
			if (l[i][j] == '#')
				zb[j + 1] += 1;
		}
		zw[j + 1] = n - zb[j + 1];
	}
	for (ll i = 1; i < 1003; i++) {
		dp[i][1] = int(1e7);
		dp[i][0] = int(1e7);
	}
	for (ll i = 1; i <= m; i++) {
		zw[i] += zw[i - 1];
		zb[i] += zb[i - 1];
	}
	for (ll i = 1; i <= m; i++) {
		for (ll j = x; j <= y; j++) {
			if (i - j >= 0) {
				ll a, b;
				a = zw[i] - zw[i - j];
				b = zb[i] - zb[i - j];
				dp[i][0] = min(dp[i][0], dp[i - j][1] + a);
				dp[i][1] = min(dp[i][1], dp[i - j][0] + b);
			}
		}
	}
	cout << min(dp[m][0], dp[m][1]);
	return 0;
}