#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
pair<int, int> rest;
int a[101][101];
int n, m, k;
int main() {
  rest = make_pair(0, 0);
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> a[i][j];
  for (int j = 1; j <= m; ++j) {
    pair<int, int> tmp = make_pair(0, 0);
    pair<int, int> tmptmp = make_pair(0, 0);
    vector<int> v;
    for (int i = 1; i <= n; ++i)
      if (a[i][j]) v.push_back(i);
    int z = 0;
    int h = 0;
    for (auto it : v) {
      while (z < v.size() && v[z] - it < k) {
        ++z;
      }
      tmptmp.first = z - h;
      tmp = max(tmp, tmptmp);
      tmptmp.second--;
      ++h;
    }
    rest.first += tmp.first;
    rest.second += tmp.second;
  }
  cout << rest.first << ' ' << -rest.second << endl;
  return 0;
}
