#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int> > mat(n, vector<int>(m));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> mat[i][j];
  int sum = 0, points = 0;
  for (int j = 0; j < m; j++) {
    int c = 0, maxc = 0, index = 0, rep = 0, maxrep = 0, firstk = 0;
    for (int i = 0; i < n; i++)
      if (mat[i][j] == 1) {
        firstk = i;
        c++;
        break;
      }
    for (int i = firstk + 1; i < n && i - firstk < k; i++)
      if (mat[i][j] == 1) c++;
    maxc = max(maxc, c);
    for (int i = firstk + k; i < n; i++) {
      if (mat[i][j] == 1) c++;
      if (mat[i - k][j] == 1) c--, rep++;
      if (c > maxc) {
        maxc = c;
        index = i - k + 1;
        maxrep = rep;
      }
    }
    sum += maxrep;
    points += maxc;
  }
  cout << points << " " << sum << endl;
}
