#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int> > v(n, vector<int>(m));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> v[i][j];
  int pen = 0, score = 0;
  for (int i = 0; i < m; i++) {
    vector<pair<int, int> > temp;
    int sum = 0;
    for (int j = 0; j < k - 1; j++) sum += v[j][i];
    int maxsum = 0;
    for (int j = 0; j < n; j++) {
      if (j + k - 1 < n) sum += v[j + k - 1][i];
      if (v[j][i]) temp.push_back(make_pair(sum, j));
      maxsum = max(maxsum, sum);
      sum -= v[j][i];
    }
    if (maxsum == 0) continue;
    score += maxsum;
    for (auto l : temp) {
      if (l.first == maxsum) {
        for (int b = 0; b < l.second - 1; b++)
          if (v[b][i]) pen++;
        break;
      }
    }
  }
  cout << score << " " << pen;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
