#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int arr[300][300], pref[300][300];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  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++)
    for (int i = 1; i <= 2 * n; i++)
      pref[i][j] = pref[i - 1][j] + (arr[i][j] == 1);
  int score = 0, ans = 0;
  for (int j = 1; j <= m; j++) {
    int tot = 0, del = 0;
    for (int i = 1; i <= n; i++) {
      if (arr[i][j] == 0) continue;
      int sum = pref[i + k - 1][j] - pref[i - 1][j];
      int left = pref[i - 1][j];
      if (sum > tot) {
        tot = sum;
        del = left;
      }
    }
    score += tot;
    ans += del;
  }
  cout << score << " " << ans;
  return 0;
}
