#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a[303][303];
int c[303][303];
int get(int x, int y, int xx, int yy) {
  return c[xx][yy] - c[x - 1][yy] - c[xx][y - 1] + c[x - 1][y - 1];
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      cin >> a[i][j];
      c[i][j] = a[i][j] + c[i - 1][j] + c[i][j - 1] - c[i - 1][j - 1];
    }
  int ans = 0;
  int cnt = 0;
  for (int j = 1; j <= m; ++j) {
    int cur = 0;
    int res = 0;
    int curCnt = 0;
    for (int i = 1; i <= n; ++i) {
      int p = min(n, i + k - 1);
      int a = get(i, j, p, j);
      if (a > cur) {
        cur = a;
        res = curCnt;
      }
      curCnt += ::a[i][j];
    }
    ans += cur;
    cnt += res;
  }
  cout << ans << ' ' << cnt << '\n';
}
