#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int k;
  cin >> k;
  int a[n][m];
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (m); j++) {
      cin >> a[i][j];
    }
  }
  int ans = 0;
  int sum = 0, msum = 0, nans = 0, ones = 0, tsum = 0;
  if (n > k) {
    k--;
    for (int i = (0); i < (m); i++) {
      sum = 0;
      nans = 0;
      for (int p = (0); p < (k + 1); p++) {
        sum += a[p][i];
      }
      ones = 0;
      msum = 0;
      if (a[0][i] == 1) ones++, msum = sum;
      for (int j = (1); j < (n - k); j++) {
        sum -= a[j - 1][i];
        sum += a[j + k][i];
        if (a[j][i] == 1) {
          if (sum > msum) {
            nans = ones;
            msum = sum;
          }
          ones++;
        }
      }
      for (int j = (n - k); j < (n); j++) {
        sum -= a[j - 1][i];
        if (a[j][i] == 1) {
          if (sum > msum) {
            nans = ones;
            msum = sum;
          }
          ones++;
        }
      }
      ans += nans;
      tsum += msum;
    }
  } else {
    for (int i = (0); i < (n); i++) {
      for (int j = (0); j < (m); j++) {
        tsum += a[i][j];
      }
    }
  }
  cout << tsum << " " << ans;
  return 0;
}
