#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k, u = 0, ans1 = 0, ans2 = 0;
  cin >> n >> m >> k;
  bool a[n][m];
  long long sum[n + 2][m];
  memset(sum, 0, sizeof(sum));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> a[i][j];
      sum[i][j] = (i ? sum[i - 1][j] : 0) + a[i][j];
      if (i >= k) sum[i][j] -= a[u][j];
      if (sum[i][j] > sum[n][j]) {
        sum[n][j] = sum[i][j];
        sum[n + 1][j] = i - k + 1;
      }
    }
    u += (i >= k);
  }
  for (long long j = 0; j < m; j++) {
    ans1 += sum[n][j];
    for (long long i = 0; i < sum[n + 1][j]; i++) ans2 += a[i][j];
  }
  cout << ans1 << " " << ans2;
  return 0;
}
