#include <bits/stdc++.h>
using namespace std;
const int64_t N = 111;
int64_t a[N][N];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t n, m, k, mn = 0, ans = 0;
  cin >> n >> m >> k;
  for (int64_t i = 0; i < n; ++i)
    for (int64_t j = 0; j < m; ++j) cin >> a[j][i];
  for (int64_t j = 0; j < m; ++j) {
    int64_t ps[N] = {};
    for (int64_t i = 1; i <= n; ++i) ps[i] = ps[i - 1] + a[j][i - 1];
    int64_t mx = 0;
    int64_t cnt = 0;
    for (int64_t i = k; i <= n; ++i)
      if (ps[i] - ps[i - k] > mx) {
        mx = ps[i] - ps[i - k];
        cnt = ps[i - k];
      }
    mn += cnt;
    ans += mx;
  }
  cout << ans << ' ' << mn << endl;
}
