#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
const int MOD = 1e9 + 9;
int mod_sum(int a, int b) { return ((a + b) % MOD + MOD) % MOD; }
int mod_sub(int a, int b) { return ((a - b) % MOD + MOD) % MOD; }
int mod_mul(int a, int b) { return 1ll * a * b % MOD; }
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int> > v(n, vector<int>(m));
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> v[i][j];
  int score = 0, changes = 0;
  for (int j = 0; j < m; ++j) {
    int cnt = 0;
    for (int i = 0; i < k; ++i) cnt += v[i][j];
    int del = 0;
    int colScore = 0, colChanges = 0;
    for (int i = 0; i < n; ++i) {
      if (v[i][j] == 1) {
        if (cnt > colScore) {
          colScore = cnt;
          colChanges = del;
        }
      }
      del += v[i][j];
      cnt -= v[i][j];
      if (i + k < n) cnt += v[i + k][j];
    }
    score += colScore;
    changes += colChanges;
  }
  cout << score << ' ' << changes << endl;
}
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  solve();
  return 0;
}
