#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a[210][210];
int dcnt;
int s;
int main() {
  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 i = 1; i <= m; i++) {
    int pos = -1;
    int mcnt = 0;
    for (int j = 1; j + k - 1 <= n; j++) {
      int cnt = 0;
      for (int l = j; l <= j + k - 1; l++) cnt += a[l][i];
      if (mcnt < cnt) {
        mcnt = cnt;
        pos = j;
      }
    }
    if (pos != -1) {
      for (int j = pos - 1; j >= 1; j--)
        if (a[j][i]) {
          a[j][i] = 0;
          dcnt++;
        }
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[j][i] == 1) {
        s++;
        for (int l = 1; l <= k - 1; l++) {
          if (a[j + l][i]) s++;
        }
        break;
      }
    }
  }
  printf("%d %d\n", s, dcnt);
  return 0;
}
