#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
pair<long long, long long> deal(vector<bool> &v) {
  long long ans = 0, ans2 = 0;
  long long pass1s = 0;
  for (long long i = 0; i < n; ++i) {
    if (v[i] == 1) {
      long long plus = count(v.begin() + i, v.begin() + min(i + k, n), 1);
      if (plus > ans) ans2 = pass1s, ans = plus;
    }
    pass1s += v[i];
  }
  return {ans, ans2};
};
long long bo[200][200];
int main() {
  scanf("%lld%lld%lld", &n, &m, &k);
  long long score = 0, move = 0;
  for (long long i = 0; i < n; ++i)
    for (long long j = 0; j < m; ++j) scanf("%lld", &bo[i][j]);
  for (long long i = 0; i < m; ++i) {
    vector<bool> v(n);
    for (long long j = 0; j < n; ++j) v[j] = bo[j][i];
    pair<long long, long long> ans = deal(v);
    score += ans.first, move += ans.second;
  }
  printf("%lld %lld\n", score, move);
}
