#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, m, k, a[N][N], ans1, ans2;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%d", &a[i][j]);
  for (int j = 1; j <= m; j++) {
    int Max = 0;
    for (int i = 1; i <= n; i++) {
      int num = 0;
      for (int l = i; l <= n && l < i + k; l++)
        if (a[l][j] == 1) num++;
      Max = max(num, Max);
    }
    ans1 += Max;
    for (int i = 1; i <= n; i++)
      if (a[i][j] == 1) {
        int num = 0;
        for (int l = i; l <= n && l < i + k; l++)
          if (a[l][j] == 1) num++;
        if (num < Max)
          ans2++;
        else
          break;
      }
  }
  printf("%d %d\n", ans1, ans2);
}
