#include <bits/stdc++.h>
const long double PI = 3.1415926535897932384626433832795;
using namespace std;
pair<long long, long long> ans[111];
long long a[111][111];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, k, i, j, w;
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (i = 1; i <= m; i++) {
    long long kol = 0, mx = 0;
    for (j = 1; j <= n; j++) {
      if (a[j][i] == 1) {
        kol++;
        long long poz = min(k, n - j + 1), sum = 0;
        for (w = j; w < j + poz; w++) {
          if (a[w][i] == 1) {
            sum++;
          }
        }
        if (sum > mx) {
          ans[i].first = kol - 1, ans[i].second = sum;
          mx = sum;
        }
      }
    }
  }
  long long sum = 0, kol = 0;
  for (i = 1; i <= m; i++) {
    kol += ans[i].first, sum += ans[i].second;
  }
  cout << sum << " " << kol;
  return 0;
}
