#include <bits/stdc++.h>
using namespace std;
int a[110][110], arr[110];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  int ans = 0, cnt = 0;
  for (int j = 1; j <= m; j++) {
    for (int i = 1; i <= n; i++) arr[i] = a[i][j];
    int st = 0, mx = 0, id = 0;
    for (int t = 1; t <= n; t++) {
      if (arr[t] == 0) continue;
      int tmp = 0, tp = 0;
      for (int ii = t; ii <= min(t + k - 1, n); ii++)
        if (arr[ii] == 1) tmp++;
      if (mx < tmp) {
        mx = tmp;
        for (int ii = 1; ii < t; ii++)
          if (arr[ii] == 1) tp++;
        id = tp;
      }
    }
    ans += mx, cnt += id;
  }
  cout << ans << " " << cnt << endl;
  return 0;
}
