#include <bits/stdc++.h>
using namespace std;
int n, m, K;
int MAP[105][105];
int main() {
  cin >> n >> m >> K;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> MAP[i][j];
  int CNT = 0, ANS = 0;
  for (int i = 0; i < m; i++) {
    int cnt = 0;
    int tcnt = 0;
    int tans = 0;
    for (int j = 0; j < n; j++) {
      int ttans = 0;
      for (int k = j, num = 0; k < n && num < K; k++, num++) {
        if (MAP[k][i]) ttans++;
      }
      if (ttans > tans) {
        tans = ttans;
        tcnt = cnt;
      }
      if (MAP[j][i]) cnt++;
    }
    CNT += tcnt;
    ANS += tans;
  }
  cout << ANS << ' ' << CNT << endl;
}
