#include <stdio.h>

int main () {
  unsigned int n,m,p,k;
  unsigned int matrica[n][m];
  unsigned int i,j,s=0;
  scanf("%u%u", &n,&m);
  scanf("%u%u", &p, &k);
  for(i=0;i<n;i++) {
    for(j=0;j<m;j++)
      scanf("%u", &matrica[i][j]);
  }
  printf("\n");
}


if((p>m) || (k>n)) {
  printf("-1");
  return 0;
}

for(i=0;i<n-k;i++) {
  for(j=0;j<m-p;j++){
    s+=matrica[i][j];
  }
}
printf("%u\n", s);

return 0;
}
    