#include <bits/stdc++.h>
using namespace std;
bool s[102][102];
vector<long long> v;
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) cin >> s[i][j];
  long long scr = 0;
  long long ch = 0;
  for (long long j = 0; j < m; j++) {
    v.clear();
    for (long long i = 0; i < n; i++)
      if (s[i][j] == 1) v.push_back(i);
    if (v.empty()) continue;
    long long tmp = 0;
    long long an = -1e15;
    long long c = 0;
    long long rc = 0;
    for (long long i = 0; i < v.size(); c++) {
      while (v[i] - v[c] < k && i < v.size()) {
        tmp++;
        i++;
      }
      if (tmp > an) {
        an = tmp;
        rc = c;
      }
      tmp--;
    }
    ch += rc;
    scr += an;
  }
  cout << scr << " " << ch;
  return 0;
}
