#include <bits/stdc++.h>
const int maxn = 2e5 + 9;
using namespace std;
int arr[111][111], sum[111][111];
int main() {
  int n, m, k;
  ios::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> arr[i][j];
    }
  }
  int ans = 0, tol = 0;
  for (int j = 1; j <= m; j++) {
    int ma = 0, bian = 0;
    for (int i = 1; i <= n; i++) {
      sum[i][j] = arr[i][j] + sum[i - 1][j];
    }
    for (int i = k; i <= n; i++) {
      if (sum[i][j] - sum[i - k][j] > ma) {
        ma = sum[i][j] - sum[i - k][j];
        bian = sum[i - k][j];
      }
    }
    ans += ma, tol += bian;
  }
  cout << ans << ' ' << tol << endl;
}
