#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int>> grid(n, vector<int>(m));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> grid[i][j];
  vector<vector<int>> sum(n + 1, vector<int>(m));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) sum[i + 1][j] = sum[i][j] + grid[i][j];
  }
  int ans = 0, ans2 = 0;
  for (int i = 0; i < m; i++) {
    int best = 0, bnum = 0;
    for (int j = 0; j < n; j++) {
      if (grid[j][i]) {
        if (sum[min(n, j + k)][i] - sum[j][i] > best)
          best = sum[min(n, j + k)][i] - sum[j][i], bnum = j;
      }
    }
    ans += best;
    if (sum[bnum + 1][i]) ans2 += sum[bnum + 1][i] - 1;
  }
  cout << ans << " " << ans2 << '\n';
  return 0;
}
