#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int> > mas(n, vector<int>(m));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) cin >> mas[i][j];
  }
  int sum = 0, change = 0;
  for (int i = 0; i < m; ++i) {
    int ch = 0, s = 0, bch = 0, bs = 0;
    for (int j = 0; j < k; ++j) {
      if (mas[j][i] == 1) ++s;
    }
    bs = s;
    for (int j = k; j < n; ++j) {
      if (mas[j - k][i] == 1) ++ch, --s;
      if (mas[j][i] == 1) ++s;
      if (s >= bs) {
        if (s > bs)
          bs = s, bch = ch;
        else if (s == bs)
          bch = min(bch, ch);
      }
    }
    sum += bs, change += bch;
  }
  cout << sum << ' ' << change;
}
