#include <bits/stdc++.h>
using namespace std;
int arr[102][101], cnt[102][101], cost[102][101], answer[102][101];
int main() {
  ios_base::sync_with_stdio(0);
  int i, j, k, l, n, m, tmp, ans = 0, st = 0, anss = 0;
  cin >> n >> m >> k;
  for (i = 1; i <= 100; i++) cnt[n + 1][i] = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> arr[i][j];
      cnt[i][j] = arr[i][j];
      cost[i][j] = 0;
      answer[i][j] = 0;
    }
  }
  for (j = 1; j <= m; j++) {
    for (i = n - 1; i >= 1; i--) {
      cnt[i][j] = cnt[i + 1][j] + arr[i][j];
    }
  }
  for (j = 1; j <= m; j++) {
    st = -1;
    int p = 0, stt;
    for (i = 1; i <= n; i++) {
      if (arr[i][j]) {
        st++;
        int yy = min(k, n - i + 1);
        if (p < cnt[i][j] - cnt[i + yy][j]) {
          p = cnt[i][j] - cnt[i + yy][j];
          stt = st;
        }
      }
    }
    if (st != -1) {
      ans += p;
      anss += stt;
    }
  }
  cout << ans << " " << anss << "\n";
  return 0;
}
