#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)110;
vector<pair<int, int> > v1[MAXN];
int arr[MAXN][MAXN];
int n, m, k;
bool check(int colno) {
  for (int i = 1; i <= n; i += 1) {
    if (arr[i][colno] == 1) {
      return true;
    }
  }
  return false;
}
pair<int, int> dotryhard(int colno) {
  pair<int, int> ret = {0, 0};
  int onesencountered = 0;
  for (int i = 1; i <= n; i += 1) {
    if (arr[i][colno] == 1) {
      int ans = 0;
      int idx = i;
      int cntr = min(k, n - i + 1);
      while (cntr--) {
        ans += arr[idx][colno];
        idx += 1;
      }
      if (ans > ret.first) {
        ret = {ans, onesencountered};
      } else if (ans == ret.first) {
        ret.second = min(ret.second, onesencountered);
      }
      onesencountered += 1;
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i += 1) {
    for (int j = 1; j <= m; j += 1) {
      cin >> arr[i][j];
    }
  }
  pair<int, int> ans = {0, 0};
  for (int j = 1; j <= m; j += 1) {
    if (check(j) == false) {
      continue;
    }
    pair<int, int> cool = dotryhard(j);
    ans.first += cool.first;
    ans.second += cool.second;
  }
  cout << ans.first << " " << ans.second << endl;
  return 0;
}
