#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> v(n, vector<long long>(m));
  long long k;
  cin >> k;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> v[i][j];
    }
  }
  for (long long j = 0; j < m; j++) {
    long long temp = 0;
    for (long long i = 0; i < n; i++) {
      v[i][j] += temp;
      temp = v[i][j];
    }
  }
  long long ans = 0;
  long long swap = 0;
  for (long long j = 0; j < m; j++) {
    long long temp = v[k - 1][j], idx = 0;
    for (long long i = 1; i < n; i++) {
      if (v[i][j] >= 1) {
        if (i + k - 1 < n) {
          if (temp < v[i + k - 1][j] - v[i - 1][j]) {
            temp = v[i + k - 1][j] - v[i - 1][j];
            idx = i;
          }
        } else {
          if (temp < v[n - 1][j] - v[i - 1][j]) {
            temp = v[n - 1][j] - v[i - 1][j];
            idx = i;
          }
        }
      }
    }
    if (temp != 0) {
      ans += temp;
      if (idx != 0) swap += v[idx - 1][j];
    }
  }
  cout << ans << " " << swap;
}
