#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
using vll = vector<long long>;
using vii = vector<pair<int, int>>;
const int N = 105;
int matrix[N][N];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &matrix[i][j]);
  int score = 0, replace = 0;
  for (int j = 0; j < m; j++) {
    int best = 0, chop = 0, one = 0;
    for (int i = 0; i < n; i++) {
      if (matrix[i][j] == 0) continue;
      int tmp = 0;
      for (int x = 0; x < k && i + x < n; x++) tmp += matrix[i + x][j];
      if (tmp > best) {
        best = tmp;
        chop = one;
      }
      ++one;
    }
    score += best;
    replace += chop;
  }
  printf("%d %d\n", score, replace);
}
