#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, k, i, j, l, ans = 0, penality = 0, mx, ad;
  cin >> n >> m >> k;
  long long int a[n][m], count[n][m];
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) cin >> a[i][j];
  }
  for (i = 0; i < m; i++) {
    if (a[0][i] == 1)
      count[0][i] = 1;
    else
      count[0][i] = 0;
    for (j = 1; j < n; j++) {
      if (a[j][i] == 1)
        count[j][i] = 1 + count[j - 1][i];
      else
        count[j][i] = count[j - 1][i];
    }
  }
  for (i = 0; i < m; i++) {
    mx = count[k - 1][i];
    ad = 0;
    for (j = 1; j <= n - k; j++) {
      if (count[j + k - 1][i] - count[j - 1][i] > mx) {
        mx = count[j + k - 1][i] - count[j - 1][i];
        ad = count[j - 1][i];
      }
    }
    ans += mx;
    penality += ad;
  }
  cout << ans << " " << penality;
  return 0;
}
