#include <bits/stdc++.h>
using namespace std;
const int M = log2(300000);
int main() {
  int p[200][200], n, m, k, i, j;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) scanf("%d", &p[i][j]);
  pair<int, int> now, aux, ans = make_pair(0, 0);
  for (j = 0; j < m; j++) {
    now = make_pair(0, 0), aux = make_pair(0, 0);
    for (i = 0; i < n; i++) {
      aux.first += p[i][j];
      if (i - k >= 0) aux.second += p[i - k][j], aux.first -= p[i - k][j];
      if (now.first < aux.first) now = aux;
    }
    ans.first += now.first, ans.second += now.second;
  }
  printf("%d %d\n", ans.first, ans.second);
}
