#include <bits/stdc++.h>
using namespace std;
const long long N = 500005;
const long long mod = 1e9 + 7;
long long dp[105][105];
void solve() {
  long long x = 0, y = 0, c = 0, ans = 0, ans1 = 0, x1 = 0;
  long long n, m, k;
  cin >> n >> m >> k;
  long long a[n][m];
  for (long long i = 0; i < n; ++i) {
    for (long long j = 0; j < m; j++) {
      cin >> a[i][j];
      dp[i][j] = (i > 0) * dp[i - 1][j] + a[i][j];
    }
  }
  for (long long j = 0; j < m; ++j) {
    x = 0, y = 0, c = 0, x1 = 0;
    for (long long i = 0; i < n; ++i) {
      if (!a[i][j]) continue;
      c = dp[min(i + k, n) - 1][j] - (i > 0) * dp[i - 1][j];
      if (c > x) {
        x = c;
        x1 = y;
      }
      y++;
    }
    ans += x;
    ans1 += x1;
  }
  cout << ans << " " << ans1 << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
