#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int mat[105][105], one[105][105];
int mx[105], rem[105];
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", &mat[i][j]);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (mat[i][j]) one[i][j]++;
      one[i][j] += one[i - 1][j];
    }
  }
  for (int j = 1; j <= m; ++j) {
    int sum = 0;
    for (int i = 1; i <= k; ++i) sum += mat[i][j];
    mx[j] = sum;
    rem[j] = 0;
    for (int i = k + 1; i <= n; ++i) {
      sum -= mat[i - k][j];
      sum += mat[i][j];
      if (sum > mx[j]) {
        mx[j] = sum;
        rem[j] = one[i - k][j];
      }
    }
  }
  int ans = 0, mn = 0;
  for (int j = 1; j <= m; ++j) ans += mx[j], mn += rem[j];
  printf("%d %d\n", ans, mn);
  return 0;
}
