#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int x[105][105];
pair<int, int> cnt[105];
int fir[105], sum[105];
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> x[i][j];
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (x[j][i] == 1 && !fir[i]) {
        fir[i] = j;
      }
      if (x[j][i] == 1) {
        int p = 0;
        for (int a = j; a <= j + min(k, n - j + 1) - 1; a++) {
          p += x[a][i];
        }
        if (p > cnt[i].first) {
          cnt[i] = make_pair(p, j);
        }
      }
    }
  }
  int ans = 0, kst = 0;
  for (int i = 1; i <= m; i++) {
    ans += cnt[i].first;
    for (int j = 1; j < cnt[i].second; j++) {
      kst += x[j][i];
    }
  }
  cout << ans << " " << kst;
  return 0;
}
