#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int arr[105][105];
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) cin >> arr[i][j];
  }
  long long ans = 0, deletions = 0;
  for (int i = 1; i <= m; ++i) {
    vector<int> ones(n + 1);
    ones[0] = 0;
    for (int j = 1; j <= n; ++j) {
      if (arr[j][i])
        ones[j] = ones[j - 1] + 1;
      else
        ones[j] = ones[j - 1];
    }
    if (ones[n] == 0) continue;
    long long minDeletions = 0, deletionsHere = 0, maxAns = 0;
    for (int j = 1; j <= n; ++j) {
      if (arr[j][i] == 0) continue;
      int x = j + k - 1;
      if (x > n) x = n;
      if (ones[x] - ones[j - 1] > maxAns) {
        maxAns = ones[x] - ones[j - 1];
        minDeletions = deletionsHere;
      }
      ++deletionsHere;
    }
    ans += maxAns;
    deletions += minDeletions;
  }
  cout << ans << " " << deletions << endl;
  return 0;
}
