#include <bits/stdc++.h>
using namespace std;
int main(){
ifstream cin("elimin.in");
ofstream cout("elimin.out");
int n, m, r, c, sum = 0, ans = 0;
cin >> n >> m >> r >> c;
vector<vector<int> > v(n + 1, vector<int>(m + 1)), cpy(n + 1, vector<int>(m + 1));
vector<int> lin(n + 1);
vector<bool> qlin(n + 1), qcol(m + 1);
for(int i = 1; i <= n; ++i)
for(int j = 1; j <= m; ++j)
cin >> v[i][j], cpy[i][j] = v[i][j];
int ch = 1 << m;
for(int i = 0; i < ch; ++i){
if(__builtin_popcount(i) != r)continue;
fill(qcol.begin(), qcol.end(), 0);
for(int j = 0; j < m; ++j)
if((i >> j) & 1)
qcol[j + 1] = 1;
sum = 0;
for(int x = 1; x <= n; ++x)
for(int y = 1; y <= m; ++y)
cpy[x][y] = v[x][y];
fill(lin.begin(), lin.end(), 0);
for(int x = 1; x <= n; ++x){
for(int y = 1; y <= m; ++y){
if(qcol[y])
cpy[x][y] = 0;
sum += cpy[x][y];
lin[x] += cpy[x][y];
}
}
sort(lin.begin(), lin.end());
for(int x = 1; x <= r; ++x)
sum -= lin[x];
ans = max(ans, sum);
}
cout << ans << '\n';
}