#include <bits/stdc++.h>
const long long int mrx = 1e6 + 5, M = 1e9 + 7, dm = 1e3 + 5;
const long double pi = 3.1415926535897932384626433832795028841971693993751;
long long int mx = -1e18, mn = 1e18;
using namespace std;
long long int n, m, k, a[dm][dm], sum[dm][dm], nas[dm][dm], op, km[dm], kx[dm],
    ox;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = m - 1; j >= 0; j--) {
      if (i == n - 1) {
        sum[i][j] = a[i][j];
      } else {
        sum[i][j] = sum[i + 1][j] + a[i][j];
      }
      if (n - i <= k) {
        nas[i][j] = sum[i][j];
      } else {
        nas[i][j] = sum[i][j] - sum[i + k][j];
      }
    }
  }
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) {
      km[j] = max(km[j], nas[i][j]);
      kx[j] = min(kx[j], nas[i][j]);
    }
    op += km[j];
  }
  cout << op << " ";
  for (int j = 0; j < m; j++) {
    if (km[j] != kx[j]) {
      for (int i = 0; i < n; i++) {
        if (nas[i][j] == km[j]) {
          if (i == 0) {
            break;
          } else {
            ox += sum[0][j] - sum[i][j];
            break;
          }
        }
      }
    }
  }
  cout << ox;
  return 0;
}
