#include <bits/stdc++.h>
using namespace std;
long long int n, m, k, a[105][105], ones[105][105];
int main() {
  scanf("%lld%lld%lld", &n, &m, &k);
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      scanf("%lld", &a[i][j]);
    }
  }
  for (long long int j = 0; j < m; j++) {
    for (long long int i = 0; i < n; i++) {
      ones[i][j] = a[i][j];
      if (i == 0) continue;
      ones[i][j] += ones[i - 1][j];
    }
  }
  long long int score = 0, replc = 0;
  for (long long int j = 0; j < m; j++) {
    long long int mx = 0, pos = 0;
    for (long long int i = 0; i < n; i++) {
      if (a[i][j] == 1) {
        long long int got = ones[min(i + k - 1, n - 1)][j];
        if (i > 0) got -= ones[i - 1][j];
        if (got > mx) {
          mx = got;
          pos = i;
        }
      }
    }
    score += mx;
    if (pos > 0) replc += ones[pos - 1][j];
  }
  printf("%lld %lld\n", score, replc);
}
