#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int maxn = 1e5 + 10;
const long long mod = 1e9 + 7;
inline int inverse(int a) {
  return a <= 1 ? 1 : (long long)(mod - mod / a) * inverse(mod % a) % mod;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
long long fsp(long long a, long long b) {
  long long ans = 1;
  for (; b; a = a * a % mod, b >>= 1)
    if (b & 1) ans = ans * a % mod;
  return ans % mod;
}
inline void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
}
int n, m, k, sum[200][200], a[200][200];
void work() {
  memset(sum, 0, sizeof(sum));
  memset(a, 0, sizeof(a));
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      int x;
      scanf("%d", &x);
      a[i][j] = x;
      sum[i][j] = sum[i - 1][j] + x;
    }
  int ans = 0, tot = 0;
  for (int i = 1; i <= m; ++i) {
    int mx = 0, pos = 0;
    for (int j = 1; j <= n; ++j) {
      if (a[j][i]) {
        int d = min(j + k - 1, n);
        if (sum[d][i] - sum[j - 1][i] > mx) {
          mx = sum[d][i] - sum[j - 1][i];
          pos = j;
        }
      }
    }
    ans += mx;
    if (pos) tot += sum[pos - 1][i];
  }
  printf("%d %d\n", ans, tot);
}
int main() {
  while (~scanf("%d%d%d", &n, &m, &k)) work();
  return 0;
}
