#include <bits/stdc++.h>
using namespace std;
const int MAX = 110;
const int INF = 1e9 + 7;
const double eps = 1e-5;
int a[110][110];
int pre[110][110];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (int j = 1; j <= m; j++) {
    for (int i = 1; i <= n; i++) {
      pre[i][j] = a[i][j] + pre[i - 1][j];
    }
  }
  int mx = -1, mn = 0, i = 1, mn1 = 0, sum = 0, sum1 = 0;
  for (int j = 1; j <= m; j++) {
    mn = 0;
    i = 1;
    mn1 = 1;
    int cur = -1, cur1 = 0;
    while (i <= n) {
      if (a[i][j] == 1) {
        cur = i;
        break;
      } else
        i++;
    }
    if (i == n + 1) {
      continue;
    }
    cur1 = pre[min(cur + k - 1, n)][j] - pre[cur - 1][j];
    mx = cur1;
    while (i <= n) {
      while (a[i][j] != 1) {
        if (i == n + 1) {
          break;
        }
        i++;
      }
      if (i == n + 1) {
        break;
      }
      i++;
      while (i <= n) {
        if (a[i][j] == 1) {
          cur = i;
          break;
        } else
          i++;
      }
      if (i == n + 1) {
        break;
      }
      cur1 = 0;
      cur1 = pre[min(cur + k - 1, n)][j] - pre[cur - 1][j];
      if (mx < cur1) {
        mx = cur1;
        mn = mn1;
      }
      mn1++;
    }
    sum += mx;
    sum1 += mn;
  }
  cout << sum << ' ' << sum1 << endl;
}
