#include <bits/stdc++.h>
int n, m, k;
int a[110][110];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &(a[i][j]));
  int score = 0, front = 0;
  for (int col = 0; col < m; col++) {
    int curCount = 0;
    int max = 0;
    int maxFront = 0;
    int curSection = 0;
    int curFront = 0;
    int pStart = 0;
    while (a[pStart][col] == 0) pStart++;
    int limit = k + pStart;
    if (limit > n) limit = n;
    for (int r = pStart; r < limit; r++) curSection = curSection + a[r][col];
    max = curSection;
    for (int r = limit; r < n; r++) {
      curSection = curSection + a[r][col] - a[r - k][col];
      curFront = curFront + a[r - k][col];
      if (a[r][col] == 1) {
        if (max < curSection) {
          max = curSection;
          maxFront = curFront;
        }
      }
    }
    score = score + max;
    front = front + maxFront;
  }
  printf("%d %d\n", score, front);
  return 0;
}
