#include <bits/stdc++.h>
using namespace std;
int a[110][110], ps[110][110];
int main() {
  int n, m, k;
  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) {
    for (int j = 1; j <= n; ++j) {
      ps[j][i] = ps[j - 1][i] + a[j][i];
    }
  }
  int rem = 0, score = 0;
  for (int i = 1; i <= m; ++i) {
    int r = -1, rmx, mx = 0;
    for (int j = 1; j <= n; ++j) {
      if (a[j][i] == 0) continue;
      ++r;
      int t = min(j + k - 1, n);
      int num = ps[t][i] - ps[j - 1][i];
      if (num > mx) {
        mx = num;
        rmx = r;
      }
    }
    if (r != -1) {
      score += mx;
      rem += rmx;
    }
  }
  printf("%d %d\n", score, rem);
}
