#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const long long LINF = 1000000000000000000;
const long long MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline void add(T& a, T b) {
  a = ((a + b) % MOD + MOD) % MOD;
};
int mat[111][111];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> mat[i][j];
    }
  int ma = 0, cnt = 0;
  for (int j = 0; j < m; j++) {
    int tma = 0, tcnt = 0, del = 0;
    for (int i = 0; i < n; i++) {
      int tmp = 0;
      if (mat[i][j]) {
        for (int l = i; l < n && l < k + i; l++) {
          if (mat[l][j]) tmp++;
        }
        if (chmax(tma, tmp)) {
          tcnt = del;
        }
        del++;
      }
    }
    ma += tma;
    cnt += tcnt;
  }
  cout << ma << " " << cnt << endl;
}
