#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 10;
int n, m, k;
int a[maxn][maxn];
int suf[maxn];
int x, y;
int get(int l, int r) { return suf[l] - suf[r + 1]; }
void solve() {
  for (int j = 1; j <= m; ++j) {
    suf[n + 1] = 0;
    for (int i = n; i >= 1; --i) suf[i] = suf[i + 1] + a[i][j];
    int ans = -1;
    int id = -1;
    int cur = 0;
    int add = 0;
    for (int i = 1; i <= n; ++i) {
      if (get(i, min(n, i + k - 1)) > ans) {
        ans = get(i, min(n, i + k - 1));
        id = i;
        add = cur;
      }
      cur += a[i][j];
    }
    if (ans != -1) {
      x += ans;
      y += add;
    }
  }
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> a[i][j];
  solve();
  cout << x << " " << y << '\n';
  return 0;
}
