#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int>> grid(n + 1, vector<int>(m + 1, 0));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> grid[i][j];
    }
  }
  int maxScore = 0, minRep = 0;
  for (int j = 1; j <= m; j++) {
    vector<int> oct(n + 1, 0);
    for (int i = 1; i <= n; i++) {
      oct[i] = oct[i - 1] + grid[i][j];
    }
    int sc = 0, rep = 0;
    for (int i = 1; i <= n; i++) {
      int curSc = oct[min(n, i + k - 1)] - oct[i - 1];
      int curRep = oct[i - 1];
      if (curSc > sc) {
        sc = curSc;
        rep = curRep;
      }
    }
    maxScore += sc;
    minRep += rep;
  }
  cout << maxScore << " " << minRep;
  return 0;
}
