#include <bits/stdc++.h>
using namespace std;
template <typename T>
T next_int() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return p * x;
}
string next_token() {
  char ch;
  string ans = "";
  do {
    ch = getchar();
  } while (ch <= ' ');
  while (ch > ' ') {
    ans += ch;
    ch = getchar();
  }
  return ans;
}
const long long INF = (long long)1e18;
const int INFINT = (int)1e9 + 227 + 1;
const int MAXN = (int)1e3 + 227 + 1;
const int MOD = (int)1e9 + 7;
const long double EPS = 1e-9;
long long bin_pow(long long a, long long b) {
  if (!b) return 1;
  long long ans = bin_pow(a, b / 2);
  ans = ans * ans % MOD;
  if (b % 2) ans = ans * a % MOD;
  return ans;
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int> > a(n, vector<int>(m));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) a[i][j] = next_int<int>();
  int ans = 0, lol = 0;
  for (int j = 0; j < m; j++) {
    vector<int> dp(n);
    for (int i = 0; i < n; i++) {
      dp[i] = (i ? dp[i - 1] : 0) + a[i][j];
    }
    int temp = 0, loli = 0, pep = 0;
    for (int i = 0; i < n; i++) {
      if (dp[min(n - 1, i + k - 1)] - (i ? dp[i - 1] : 0) > temp) {
        temp = dp[min(n - 1, i + k - 1)] - (i ? dp[i - 1] : 0);
        loli = pep;
      }
      pep += a[i][j];
    }
    ans += temp;
    lol += loli;
  }
  cout << ans << " " << lol << "\n";
}
