#include <bits/stdc++.h>
void nop();
using namespace std;
const int inf = (int)1e9;
const long long infl = (long long)2e18;
const int mod = 1000000007;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int> > a(n, vector<int>(m));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> a[i][j];
    }
  }
  int ans = 0;
  int replaces = 0;
  for (int j = 0; j < m; ++j) {
    pair<int, int> cans = {INT_MIN, 0};
    vector<int> sum(n + 1);
    sum[0] = 0;
    for (int i = 0; i < n; ++i) {
      sum[i + 1] = sum[i] + a[i][j];
    }
    for (int l = 1; l <= n; ++l) {
      int csum = sum[min(n, l + k - 1)] - sum[l - 1];
      int creplaces = sum[l - 1];
      pair<int, int> ccans = {csum, -creplaces};
      cans = max(cans, ccans);
    }
    ans += cans.first;
    replaces += -cans.second;
  }
  cout << ans << " " << replaces << endl;
  return 0;
}
