#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int read() {
  int ret = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  for (; ch >= '0' && ch <= '9'; ch = getchar()) ret = ret * 10 + ch - '0';
  return ret;
}
int n, m, k;
const int MAX_N = 105;
int G[MAX_N][MAX_N];
int ans1, ans2;
vector<int> pos[MAX_N];
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", &G[i][j]);
      if (G[i][j] == 1) {
        pos[j].push_back(i);
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    int temp = 0, rep = 0;
    for (int j = 0; j < pos[i].size(); j++) {
      int t = 0;
      for (int x = pos[i][j]; x < min(k + pos[i][j], n + 1) && x <= n; x++) {
        if (G[x][i] == 1) {
          t++;
        }
      }
      if (t > temp) {
        temp = t;
        rep = j;
      }
    }
    ans1 += temp;
    ans2 += rep;
  }
  printf("%d %d\n", ans1, ans2);
  return 0;
}
