#include <bits/stdc++.h>
using namespace std;
int arr[105][105];
int pref[105][105];
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 >> arr[i][j];
  for (int j = 1; j <= m; j++) {
    int sum = 0;
    for (int i = n; i >= 1; i--) {
      sum += arr[i][j];
      pref[i][j] = sum;
    }
  }
  int ans = 0, change = 0;
  for (int j = 1; j <= m; j++) {
    int mx = 0, curc = 0;
    for (int i = 1; i <= n; i++) {
      if (arr[i][j] == 1) {
        if (pref[i][j] - pref[min(n + 1, i + k)][j] > mx) {
          mx = pref[i][j] - pref[min(n + 1, i + k)][j];
          curc = pref[1][j] - pref[i][j];
        }
      }
    }
    ans += mx;
    change += curc;
  }
  cout << ans << " " << change << endl;
  return 0;
}
