#include <bits/stdc++.h>
using namespace std;
const int N = 1000000;
int a[110][110], n, m, k;
int main() {
  int i, j, k;
  scanf("%d%d%d", &n, &m, &k);
  memset(a, 0, sizeof(a));
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) scanf("%d", &a[i][j]);
  for (j = 1; j <= m; j++)
    for (i = 2; i <= n; i++) a[i][j] += a[i - 1][j];
  int ansx = 0, ansy = 0;
  for (j = 1; j <= m; j++) {
    int ans1 = 0, ans2 = 0, num = 0;
    for (i = 1; i <= n; i++)
      if (a[i][j] - a[i - 1][j] > 0) {
        num++;
        int tt = min(n - i + 1, k);
        if (ans1 < a[i + tt - 1][j] - a[i - 1][j]) {
          ans1 = a[i + tt - 1][j] - a[i - 1][j];
          ans2 = num - 1;
        }
      }
    ansx += ans1;
    ansy += ans2;
  }
  printf("%d %d\n", ansx, ansy);
  return 0;
}
