#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int>> a(n, vector<int>(m, 0));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> a[i][j];
    }
  }
  int score = 0, replace = 0;
  for (int j = 0; j < m; ++j) {
    map<int, int> sums;
    for (int i = 0; i < n; ++i) {
      int cur = 0;
      for (int l = i; l < i + min(k, n - i); ++l) {
        cur += a[l][j];
      }
      if (sums.find(cur) == sums.end()) {
        sums[cur] = i;
      }
    }
    pair<int, int> tmp = *--sums.end();
    score += tmp.first;
    for (int i = 0; i < tmp.second; ++i) {
      replace += a[i][j];
    }
  }
  cout << score << ' ' << replace << endl;
  return 0;
}
