#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long mat[n + 1][m + 1], sum[n + 1][m + 1];
  for (long long i = 0; i <= n; i++)
    for (long long j = 0; j <= m; j++) sum[i][j] = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      cin >> mat[i][j];
      sum[i][j] = sum[i - 1][j] + mat[i][j];
    }
  }
  long long ans = 0, rep = 0;
  for (long long j = 1; j <= m; j++) {
    long long sm = 0, trep = 0;
    for (long long i = 1; i <= n; i++) {
      if (sum[min(i + k - 1, n)][j] - sum[i - 1][j] > sm) {
        sm = sum[min(i + k - 1, n)][j] - sum[i - 1][j];
        trep = sum[i - 1][j];
      }
    }
    ans += sm;
    rep += trep;
  }
  cout << ans << " " << rep << endl;
  return 0;
}
