#include <bits/stdc++.h>
int N, M, K;
int ans[2] = {0, 0};
int grid[100][100];
int main() {
  std::cin >> N >> M >> K;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++) std::cin >> grid[i][j];
  for (int j = 0; j < M; j++) {
    int h = 0, hi = 0, c, ci = 0;
    for (int i = 0; i < N; i++) {
      if (grid[i][j] == 0) continue;
      c = 0;
      for (int k = i; k < N && k < i + K; k++) c += grid[k][j];
      if (c > h) {
        h = c;
        hi = ci;
      }
      ci++;
    }
    ans[0] += h;
    ans[1] += hi;
  }
  std::cout << ans[0] << " " << ans[1] << "\n";
  return 0;
}
