#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int N = 110, M = 100005;
int n, m, k, a[N][N];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &a[i][j]);
  int ans1 = 0, ans2 = 0;
  for (int j = 1; j <= m; ++j) {
    int mx1 = 0, mx2 = 0, s = 0;
    for (int i = 1; i <= n; ++i)
      if (a[i][j] == 1) {
        int tmp = 0;
        for (int l = i; l <= min(k, n - i + 1) + i - 1; ++l) {
          tmp += (a[l][j]);
        }
        if (mx1 < tmp) mx1 = tmp, mx2 = s;
        ++s;
      }
    ans1 += mx1, ans2 += mx2;
  }
  printf("%d %d\n", ans1, ans2);
  return 0;
}
