#include <bits/stdc++.h>
using namespace std;
int mat[105][105];
int sp[105][105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> mat[j][i];
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      sp[i][j] = sp[i][j - 1] + mat[i][j];
    }
  }
  int cont = 0;
  int scot = 0;
  for (int i = 1; i <= m; i++) {
    int MAX = 0;
    int pos = 0;
    for (int j = 0; j <= n - k; j++) {
      if (sp[i][j + k] - sp[i][j] > MAX) {
        MAX = sp[i][j + k] - sp[i][j];
        pos = j;
      }
    }
    cont += MAX;
    scot += sp[i][pos];
  }
  cout << cont << " " << scot;
  return 0;
}
