#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int N = 105;
const int M = 2e3 + 5;
int mp[N][N];
pair<int, int> sloveCol(int idx, int n, int k) {
  int sum = 0;
  pair<int, int> ans = {0, 0};
  for (int i = 0; i < n; ++i) {
    pair<int, int> tmp = {0, sum};
    for (int j = i; j < min(i + k, n); ++j) {
      tmp.first += mp[j][idx];
    }
    if (tmp.first > ans.first) {
      ans = tmp;
    }
    sum += mp[i][idx];
  }
  return ans;
}
pair<int, int> slove(int n, int m, int k) {
  pair<int, int> ans = {0, 0};
  for (int i = 0; i < m; ++i) {
    pair<int, int> tmp = sloveCol(i, n, k);
    ans.first += tmp.first;
    ans.second += tmp.second;
  }
  return ans;
}
int main() {
  int n, m, k;
  while (~scanf("%d%d%d", &n, &m, &k)) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        scanf("%d", &mp[i][j]);
      }
    }
    pair<int, int> ans = slove(n, m, k);
    printf("%d %d\n", ans.first, ans.second);
  }
  return 0;
}
