#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long g[112][112];
long long ac[112][112];
int main(void) {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> g[i][j];
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      ac[i][j] = g[j][i];
      ac[i][j] += ac[i][j - 1];
    }
  }
  long long ans = 0, ans2 = 0;
  for (int i = 1; i <= m; i++) {
    long long now = 0, cand = 0;
    for (int j = 1; j <= n; j++) {
      if (g[j][i] != 1) continue;
      long long nxt = min(k, n - j + 1);
      long long sum = ac[i][j + nxt - 1] - ac[i][j - 1];
      long long atcand = ac[i][j - 1];
      long long accand = ac[i][cand];
      if (sum > now or (sum == now and atcand < accand)) {
        now = sum;
        cand = j - 1;
      }
    }
    ans += now;
    ans2 += ac[i][cand];
  }
  cout << ans << " " << ans2 << endl;
  return 0;
}
