#include <bits/stdc++.h>
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1000000;
using namespace std;
int a[110][110];
vector<int> ans[110];
int mx[110];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, k, i, j, cnt = 0, kol = 0;
  cin >> n >> m >> k;
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= m; ++j) cin >> a[i][j];
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= m; ++j)
      if (a[i][j] == 1) {
        int res = 0;
        for (int x = i; x <= min(n, i + k - 1); ++x)
          if (a[x][j]) ++res;
        ans[j].push_back(res);
      }
  for (i = 1; i <= m; ++i) {
    for (j = 0; j < ans[i].size(); ++j) mx[i] = max(mx[i], ans[i][j]);
  }
  for (i = 1; i <= m; ++i)
    if (ans[i].size() != 0) {
      int now = 0;
      while (ans[i][now] != mx[i]) {
        ++cnt;
        ++now;
      }
      kol += mx[i];
    }
  cout << kol << " " << cnt << '\n';
  return 0;
}
