#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int mp[150][150];
int pre[150], suf[150];
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", &mp[i][j]);
  int scor = 0, nu = 0;
  for (int j = 1; j <= m; ++j) {
    memset(pre, 0, sizeof(pre));
    memset(suf, 0, sizeof(suf));
    for (int i = 1; i <= n; ++i) {
      pre[i] = pre[i - 1] + (mp[i][j] == 1 ? 1 : 0);
    }
    for (int i = n; i >= 1; --i) {
      suf[i] = suf[i + 1] + (mp[i][j] == 1 ? 1 : 0);
    }
    int pos, t = -1;
    for (int i = 1; i <= n; ++i) {
      if (mp[i][j] == 1) {
        if (t < suf[i] - suf[i + k]) {
          t = suf[i] - suf[i + k];
          pos = i;
        }
      }
    }
    if (t == -1) continue;
    scor += t;
    nu += pre[pos - 1];
  }
  printf("%d %d\n", scor, nu);
}
