#include <bits/stdc++.h>
using namespace std;
const unsigned _mod = 998244353;
const unsigned mod = 1e9 + 7;
const long long infi = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
long long ksm(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1ll) ret = ret * x % mod;
    y >>= 1ll;
    x = x * x % mod;
  }
  return ret;
}
long long qpow(long long x, long long y, long long m) {
  long long ret = 1;
  while (y) {
    if (y & 1ll) ret = ret * x % m;
    y >>= 1ll;
    x = x * x % m;
  }
  return ret;
}
long long _gcd(long long x, long long y) { return y ? _gcd(y, x % y) : x; }
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int m, n, k, a[110][110], _max, p, cnt, res, g, ans;
int main() {
  cin >> n >> m >> k;
  for (register int i = 1; i <= n; ++i)
    for (register int j = 1; j <= m; ++j) a[i][j] = read();
  for (register int j = 1; j <= m; ++j) {
    _max = p = g = 0;
    for (register int i = 1; i <= n; ++i)
      if (a[i][j] == 1) {
        cnt = 0;
        for (register int _ = i; _ <= min(i + k - 1, n); ++_)
          if (a[_][j] == 1) cnt++;
        if (cnt > _max) _max = cnt, g = p;
        p++;
      }
    res += _max;
    ans += g;
  }
  cout << res << ' ' << ans << '\n';
  return 0;
}
