#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, a[102][102] = {}, b[102][102] = {}, y = 0, z = 0;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int l = i; l <= min(n, i + k - 1); l++) b[i][j] += a[l][j];
  for (int j = 1; j <= m; j++) {
    int x = 0;
    for (int i = 1; i <= n; i++) x = max(x, b[i][j]);
    z += x;
    for (int i = 1; i <= n; i++) {
      if (b[i][j] == x) break;
      if (a[i][j]) y++;
    }
  }
  cout << z << ' ' << y;
}
