#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
using namespace std;
int v[110][110] = {};
int first[110] = {};
int cs[110][110] = {};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  memset(first, 0, sizeof(first));
  vector<vector<int> > g(m + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> v[i][j];
    }
  }
  for (int i = 1; i <= m; i++) {
    cs[i][n] = (v[n][i] == 1);
    for (int row = n - 1; row >= 1; row--) {
      cs[i][row] = cs[i][row + 1] + (v[row][i] == 1);
    }
  }
  int changed = 0, ans = 0;
  for (int i = 1; i <= m; i++) {
    int best = 0, c = 0;
    for (int j = 1; j <= n; j++) {
      if (v[j][i] == 1) {
        int lim1 = min(j + k - 1, n);
        if (cs[i][j] - cs[i][lim1 + 1] > best) {
          best = cs[i][j] - cs[i][lim1 + 1];
          c = cs[i][1] - cs[i][j];
        }
      }
    }
    ans += best;
    changed += c;
  }
  cout << ans << ' ' << changed << '\n';
  return 0;
}
