#include <bits/stdc++.h>
using namespace std;
long long int dp[105][105];
long long int a[105][105];
vector<pair<long long int, long long int> > loda[105];
bool cmp(pair<long long int, long long int> a,
         pair<long long int, long long int> b) {
  if (a.first == b.first) return a.second > b.second;
  return b.first > a.first;
}
int main() {
  std::ios::sync_with_stdio(false);
  long long int n, m, k;
  cin >> n >> m >> k;
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (long long int i = 1; i <= m; i++) loda[i].push_back({0, 0});
  for (long long int j = 1; j <= m; j++) {
    for (long long int i = 1; i <= n; i++) {
      dp[i][j] = dp[i - 1][j];
      if (a[i][j]) dp[i][j]++;
    }
  }
  long long int ans = 0;
  for (long long int i = n; i >= max(1ll, k); i--) {
    for (long long int j = 1; j <= m; j++) {
      long long int cnt = 0;
      long long int cnt2 = 0;
      cnt += dp[i][j] - dp[i - k][j];
      cnt2 += dp[i - k][j];
      loda[j].push_back({cnt, cnt2});
    }
  }
  for (long long int i = 1; i <= m; i++) {
    sort(loda[i].begin(), loda[i].end(), cmp);
    reverse(loda[i].begin(), loda[i].end());
  }
  long long int best = 0;
  for (long long int i = 1; i <= m; i++) {
    ans += loda[i][0].first;
    best += loda[i][0].second;
  }
  cout << ans << " " << best << endl;
  return 0;
}
