#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int a[105][105];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) scanf("%d", &a[i][j]);
  }
  int score = 0, re = 0;
  for (int j = 1; j <= m; j++) {
    int x = 0, y = 0, ny = 0;
    for (int i = 1; i <= n; i++) {
      int nx = 0;
      if (a[i][j] == 1) {
        ny++;
        int nex = min(k, n - i + 1);
        for (int q = 0; q < nex; q++) {
          if (a[i + q][j] == 1) nx++;
        }
        if (nx > x) {
          x = nx;
          y = ny;
        }
      }
    }
    if (x != 0) {
      y--;
      re += y;
      score += x;
    }
  }
  printf("%d %d\n", score, re);
  return 0;
}
