#include <bits/stdc++.h>
using namespace std;
void Weapons19() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  Weapons19();
  long long n, m, k;
  cin >> n >> m >> k;
  vector<vector<long long>> v(n, vector<long long>(m));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> v[i][j];
    }
  }
  long long ans = 0, t = 0;
  for (long long i = 0; i < m; i++) {
    long long a = 0, b = 0, c = 0, onel = 0, cura = 0, mxa = 0, ta = 0;
    while (b != n) {
      if (c == k) {
        if (v[a][i] == 1) {
          onel++;
          cura--;
        }
        a++;
        c--;
      } else {
        if (v[b][i] == 1) {
          cura++;
        }
        b++;
        c++;
      }
      if (cura > mxa) {
        mxa = cura;
        ta = onel;
      }
    }
    t += ta;
    ans += mxa;
  }
  cout << ans << " " << t;
}
