#include <bits/stdc++.h>
using namespace std;
const int len = 1e2 + 3;
const long long mod = 1e9 + 7;
const unsigned long long seed = 131;
int dd[len][len];
int vis[len];
int sum[len];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> dd[i][j];
  int ans1 = 0, ans2 = 0;
  for (int j = 1; j <= m; ++j) {
    for (int i = 1; i <= n; ++i) sum[i] = sum[i - 1] + dd[i][j];
    int maxx = 0, maxt = 0;
    for (int i = 1; i <= n; ++i)
      if (sum[i + min(k, n - i + 1) - 1] - sum[i - 1] > maxx) {
        maxx = sum[i + min(k, n - i + 1) - 1] - sum[i - 1];
        maxt = sum[i - 1];
      }
    ans1 += maxx;
    ans2 += maxt;
  }
  cout << ans1 << ' ' << ans2 << endl;
}
