#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int> > a(n, vector<int>(m));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> a[i][j];
    }
  }
  int sum = 0, cnt = 0;
  for (int j = 0; j < m; ++j) {
    vector<int> vct;
    for (int i = 0; i < n; ++i) {
      if (!a[i][j]) {
        continue;
      }
      int c = 0;
      for (int z = i; z < n && z - i + 1 <= k; ++z) {
        if (a[z][j]) {
          ++c;
        }
      }
      vct.push_back(c);
    }
    if (vct.empty()) {
      continue;
    }
    int best = 0;
    for (int z = 0; z < (int)(vct).size(); ++z) {
      if (vct[z] > vct[best]) {
        best = z;
      }
    }
    sum += vct[best];
    cnt += best;
  }
  cout << sum << " " << cnt << "\n";
}
