#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const long long mod = 1e9 + 7;
int mp[110][110];
int sum[110][110];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  int i, j;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) cin >> mp[i][j];
  for (j = 1; j <= m; j++)
    for (i = 1; i <= n; i++) sum[i][j] = sum[i - 1][j] + mp[i][j];
  int maxxans = 0;
  int minxans = 0;
  for (j = 1; j <= m; j++) {
    int maxx = 0;
    int minx = 0;
    int temp = 0;
    for (i = 1; i <= n; i++) {
      if (mp[i][j]) {
        int ans = sum[min(i + k - 1, n)][j] - sum[i - 1][j];
        if (ans > maxx) {
          maxx = ans;
          minx = temp;
        }
        temp++;
      }
    }
    maxxans += maxx;
    minxans += minx;
  }
  cout << maxxans << " " << minxans;
}
