#include <bits/stdc++.h>
const long long MOD = 1e9 + 7;
const int cfnum = 1e5 + 5;
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  int n, m, k, i, j;
  cin >> n >> m >> k;
  int arr[n][m];
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> arr[i][j];
    }
  }
  int sum = 0, rep = 0;
  for (i = 0; i < m; i++) {
    int num = 0, cur = 0, shrey = -1;
    for (j = 0; j < n; j++) {
      if (arr[j][i] == 1) {
        num++;
        int num2 = 1;
        for (int a = j + 1; a < n && a < j + k; a++) {
          if (arr[a][i] == 1) num2++;
        }
        if (num2 > cur) {
          cur = num2;
          shrey = num - 1;
        }
      }
    }
    if (cur != 0) {
      sum += cur;
      rep += shrey;
    }
  }
  cout << sum << " " << rep;
  return 0;
}
