#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a[105][105];
int b[105];
int sc;
int num;
void init() {
  sc = 0;
  num = 0;
}
int main() {
  init();
  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]);
    }
  }
  for (int j = 1; j <= m; j++) {
    memset(b, 0, sizeof b);
    int maxs = -1;
    int maxi;
    int s;
    bool flag = false;
    for (int i = 1; i <= n; i++) {
      if (a[i][j] == 1) {
        b[i] = b[i - 1] + 1;
        flag = true;
        int tol = min(k, n - i + 1);
        s = 0;
        for (int p = i; p < i + tol; p++) {
          if (a[p][j] == 1) s++;
        }
        if (s > maxs) {
          maxs = s;
          maxi = i;
        }
      } else {
        b[i] = b[i - 1];
      }
    }
    if (flag == true) {
      sc += maxs;
      num += b[maxi] - 1;
    }
  }
  printf("%d %d\n", sc, num);
  return 0;
}
