#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int a[maxn][maxn];
int ans1 = 0, ans2 = 0;
int main() {
  int n, m, k;
  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]);
  for (int i = 0; i < m; i++) {
    int change = 0, TMP = 0, CHANGE = 0;
    for (int j = 0; j < n; j++) {
      int h = j, tmpans = 0;
      while (h < n && a[h][i] != 1) h++;
      if (h == n) continue;
      for (int l = h; l < n && l < h + k; l++) {
        if (a[l][i] == 1) tmpans++;
      }
      if (TMP < tmpans) {
        TMP = tmpans;
        CHANGE = change;
      } else if (TMP == tmpans) {
        CHANGE = min(change, CHANGE);
      }
      if (a[j][i] == 1) change++;
    }
    ans1 += TMP, ans2 += CHANGE;
  }
  printf("%d %d\n", ans1, ans2);
  return 0;
}
