#include <bits/stdc++.h>
using namespace std;
void open() { freopen("data.txt", "r", stdin); }
void out() { freopen("out.txt", "w", stdout); }
const int INF = 0x3f3f3f3f;
const int maxn = 1e6 + 5;
const int MOD = 1e9 + 7;
int n, m, k;
int ans1 = 0, ans2 = 0;
int maps[105][105];
int sum[105][105];
void fun(int j) {
  int maxx = 0;
  for (int i = 1; i < (n + 1); ++i) sum[i][j] = sum[i - 1][j] + maps[i][j];
  if (!sum[n][j]) return;
  for (int i = 1; i < (n + 1); ++i) {
    if (!maps[i][j]) continue;
    int ni = min(i + k - 1, n);
    int tmp = sum[ni][j] - sum[i - 1][j];
    maxx = max(maxx, tmp);
  }
  ans1 += maxx;
  int ok = false;
  for (int i = 1; i < (n + 1); ++i) {
    if (!maps[i][j]) continue;
    int ni = min(i + k - 1, n);
    int tmp = sum[ni][j] - sum[i - 1][j];
    if (tmp == maxx) {
      break;
    } else
      ans2++;
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i < (n + 1); ++i)
    for (int j = 1; j < (m + 1); ++j) scanf("%d", &maps[i][j]);
  for (int j = 1; j < (m + 1); ++j) fun(j);
  printf("%d %d\n", ans1, ans2);
  return 0;
}
