#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int a[N][N], dp[N][N];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int score = 0;
  int repl = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
      dp[i][j] = dp[i - 1][j] + a[i][j];
    }
  }
  for (int j = 1; j <= m; j++) {
    int cur_mx = 0;
    int rep = 0;
    for (int i = 1; i <= n; i++) {
      if (dp[i][j] - dp[max(i - k, 0)][j] > cur_mx) {
        cur_mx = dp[i][j] - dp[max(i - k, 0)][j];
        rep = dp[i][j] - cur_mx;
      }
    }
    score += cur_mx;
    repl += rep;
  }
  cout << score << " " << repl << endl;
}
