#include <bits/stdc++.h>
using namespace std;
const int N = (int)(1e2 + 5);
int n, m, k;
int grid[N][N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  for (int(i) = (1); (i) <= (n); (i)++)
    for (int(j) = (1); (j) <= (m); (j)++) cin >> grid[i][j];
  int score = 0, updates = 0;
  for (int(j) = (1); (j) <= (m); (j)++) {
    int col_score = 0;
    int col_update = 0;
    int update = 0;
    for (int(i) = (1); (i) <= (n); (i)++) {
      if (i - 1 >= 1) update += grid[i - 1][j];
      if (grid[i][j] == 1) {
        int temp_score = 0;
        for (int q = i; q < i + k && q <= n; q++) temp_score += grid[q][j];
        if (temp_score > col_score) {
          col_score = temp_score;
          col_update = update;
        }
      }
    }
    score += col_score;
    updates += col_update;
  }
  cout << score << ' ' << updates;
  return 0;
}
