#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int>> a(n, vector<int>(m));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  int ans1 = 0, ans2 = 0;
  for (int j = 0; j < m; j++) {
    int u = 0, v = 0, ind = 0;
    for (int i = 0; i < n; i++) {
      if (a[i][j] == 0) continue;
      int count1 = 0;
      for (int l = i; l < n && l - i < k; l++) {
        if (a[l][j]) count1++;
      }
      if (count1 > u) {
        u = count1;
        ind = v;
      }
      v++;
    }
    ans1 += u;
    ans2 += ind;
  }
  cout << ans1 << ' ' << ans2 << '\n';
}
