#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int mp[200][200];
int s[200][200];
int ans = 0;
int cnt;
int del = 0;
int tmp;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= m; i++) s[0][i] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &mp[i][j]);
      s[i][j] = s[i - 1][j] + mp[i][j];
    }
  }
  for (int j = 1; j <= m; j++) {
    cnt = 0;
    tmp = 0;
    for (int i = k; i <= n; i++) {
      if (mp[i - k + 1][j] != 0) {
        if (s[i][j] - s[i - k][j] > cnt) {
          cnt = s[i][j] - s[i - k][j];
          tmp = s[i - k][j];
        }
      }
    }
    for (int i = n - k + 2; i <= n; i++) {
      if (mp[i][j] != 0) {
        if (s[n][j] - s[i - 1][j] > cnt) {
          cnt = s[n][j] - s[i - 1][j];
          tmp = s[i - 1][j];
        }
      }
    }
    ans += cnt;
    del += tmp;
  }
  printf("%d %d\n", ans, del);
  return 0;
}
