#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long n, m, k;
  cin >> n >> m >> k;
  long long A[n + 1][m + 1];
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) cin >> A[i][j];
  long long score = 0;
  long long moves = 0;
  for (long long q = 1; q <= m; q++) {
    long long s[n + 1];
    for (long long i = 1; i <= n; i++) s[i] = A[i][q];
    int sco = 0;
    int mov = n;
    long long mv = 0;
    bool kitas = true;
    for (long long i = 1; i <= n; i++) {
      if (s[i] == 1) {
        kitas = false;
        int sc = 0;
        for (int j = i; j <= n && j - i < k; j++) {
          sc += s[j];
        }
        if (sc > sco) {
          sco = sc;
          mov = mv;
        }
        mv++;
      }
    }
    if (!kitas) {
      score += sco;
      moves += mov;
    }
  }
  cout << score << " " << moves;
}
