#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T abs(T a) {
  return (a < 0) ? -a : a;
}
template <typename T>
inline T sqr(T a) {
  return a * a;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> p) {
  os << "{ " << p.first << ", " << p.second << " }";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (int i = 0; i < v.size(); i++) os << v[i] << " ";
  return os;
}
template <typename K, typename V>
ostream& operator<<(ostream& os, const unordered_map<K, V>& m) {
  os << "{ ";
  for (const auto& p : m) {
    os << p.first << ": " << p.second << ";";
  }
  os << "}";
  return os;
}
void print() { cout << endl; }
template <typename T, typename... Ts>
void print(T x, Ts... xs) {
  cout << x << " ";
  print(xs...);
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<int>> v(n, vector<int>(m, 0));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> v[i][j];
    }
  }
  int ret1 = 0;
  int ret2 = 0;
  vector<vector<int>> c(n, vector<int>(m, 0));
  for (int j = 0; j < m; j++) {
    int count = 0;
    for (int i = 0; i < n; i++) {
      if (v[i][j] == 1) count++;
      c[i][j] = count;
    }
    int w = 0;
    for (int i = n - 1; i >= n - k; i--) {
      if (v[i][j] == 1) w++;
    }
    int mc = w;
    int md = (k >= n - 1) ? 0 : c[n - k - 2][j];
    for (int i = n - k - 1; i >= 0; i--) {
      w -= v[i + k][j] - v[i][j];
      if (w >= mc) {
        mc = w;
        md = (i == 0) ? 0 : c[i - 1][j];
      }
    }
    ret1 += mc;
    ret2 += md;
  }
  cout << ret1 << " " << ret2 << endl;
}
