#include <bits/stdc++.h>
using namespace std;
inline long long int gcd(long long int x, long long int y) {
  return x % y == 0 ? y : gcd(y, x % y);
}
inline long long int lcm(long long int x, long long int y) {
  return x * (y / gcd(x, y));
}
inline long long int powmod(long long int a, long long int b,
                            long long int mod) {
  long long int res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
inline long long int mulmod(long long int a, long long int b, long long int c) {
  if (!b) return 0;
  long long int x = mulmod(a, b / 2, c);
  if (b & 1) return (x + x + a) % c;
  return (x + x) % c;
}
long long int ans[101][101];
int main() {
  long long int n, m, k;
  cin >> n >> m >> k;
  long long int a[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      int c = 0;
      for (int l = j; l < min(j + k, n); l++) {
        if (a[l][i] == 1) c++;
      }
      ans[j][i] = c;
    }
  }
  long long int tot = 0, sum = 0;
  for (int i = 0; i < m; i++) {
    int mm = -1, ind = -1;
    for (int j = 0; j < n; j++) {
      if (a[j][i] == 1 && ans[j][i] > mm) {
        ind = j;
        mm = ans[j][i];
      }
    }
    mm = 0;
    for (int j = 0; j < ind; j++) {
      if (a[j][i] == 1) mm++;
    }
    if (ind != -1) sum += ans[ind][i];
    tot += mm;
  }
  cout << sum << " " << tot << endl;
  return 0;
}
