#include <bits/stdc++.h>
using namespace std;
template <class T>
void show(const vector<T> &a) {
  for (T x : a) cout << x << " ";
  cout << '\n';
}
vector<long long> xx = {1, 0, -1, 0};
vector<long long> yy = {0, 1, 0, -1};
string dir = "LRUD";
const long long N = 2e5 + 50, oo = 3e18 + 500;
const long long mod = 1e9 + 7;
const long double eps = 1e-7, PI = 2 * acos(0.0);
long long n, m, k;
long long cnt = 0;
long long lg = 18;
vector<long long> g[N];
vector<long long> rg[N];
vector<long long> visit(N, 0);
signed main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> n >> m >> k;
  vector<vector<long long> > t(n, vector<long long>(m));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> t[i][j];
    }
  }
  vector<vector<long long> > del(m);
  for (long long j = 0; j < m; j++) {
    long long num = 0;
    for (long long i = 0; i < n; i++) {
      if (t[i][j] == 1) {
        cnt = 0;
        long long score = 0;
        for (long long z = i; z < n && cnt < k; z++) {
          score += t[z][j];
          cnt++;
        }
        del[j].push_back(score);
      }
    }
  }
  long long sum = 0, cnt_del = 0;
  for (long long j = 0; j < m; j++) {
    cnt = 0;
    for (long long i = 0; i < ((long long)(del[j].size())); i++) {
      cnt = max(cnt, del[j][i]);
      ;
    }
    sum += cnt;
    for (long long i = 0; i < ((long long)(del[j].size())); i++) {
      if (cnt == del[j][i]) {
        cnt_del += i;
        break;
      }
    }
  }
  cout << sum << " " << cnt_del << '\n';
}
