#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long ar[n][m];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) cin >> ar[i][j];
  }
  long long dp[n][m];
  long long ans = 0;
  long long pos[m];
  for (long long j = 0; j < m; j++) {
    long long sum = 0;
    for (long long i = 0; i < k; i++) {
      sum += ar[i][j];
    }
    dp[0][j] = sum;
    long long maxi = sum;
    for (long long i = 1; (i + k - 1) < n; i++) {
      sum = sum - ar[i - 1][j] + ar[i + k - 1][j];
      dp[i][j] = sum;
      maxi = max(maxi, sum);
    }
    ans += maxi;
    pos[j] = maxi;
  }
  long long ans1 = 0;
  for (long long j = 0; j < m; j++) {
    for (long long i = 0; (i + k - 1) < n; i++) {
      if (dp[i][j] == pos[j]) {
        break;
      } else {
        ans1 += (ar[i][j] == 1);
      }
    }
  }
  cout << ans << " " << ans1;
}
