#include <bits/stdc++.h>
using namespace std;
int mt[200][200];
int mi;
struct node {
  int pos, presum, sum;
  bool operator<(const node& b) const {
    if (sum == b.sum) return pos < b.pos;
    return sum > b.sum;
  }
};
vector<node> v;
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &mt[i][j]);
    }
  }
  int res = 0, cnt = 0;
  for (int i = 1; i <= m; i++) {
    v.clear();
    int presum = 0;
    for (int j = 1; j <= n; j++) {
      mi = min(n - j + 1, k);
      int sum = 0;
      for (int k = j; k <= n && k <= j + mi - 1; k++) {
        if (mt[k][i] == 1) sum++;
      }
      v.push_back((node){j, presum, sum});
      if (mt[j][i] == 1) presum++;
    }
    sort(v.begin(), v.end());
    res += v[0].sum;
    cnt += v[0].presum;
  }
  printf("%d %d", res, cnt);
  return 0;
}
