#include <iostream>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define endl "\n"
#define ON(n , k) ((n) | (1 << (k)))
#define OFF(n , k) ((n) & ~(1 << (k)))
#define isON(n , k) (((n) >> (k)) & 1)
#define IN() freopen("bad-memes.in", "r", stdin);
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> orderSet;
void Erase(orderSet &s, int val) {
int rank = s.order_of_key(val);
auto it = s.find_by_order(rank);
s.erase(it);
}
bool is_prime(ll n) {
if(n<2) {
return false;
}
for (int i=2;i*i<=n;++i) {
if(n%i==0) {
return false;
}
}
return true;
}
vector<ll> divisors(ll x) {
vector<ll> divs;
for (int i = 1; i * i <= x; i++) {
if (x % i == 0) {
divs.push_back(i);
if (i != x / i) {
divs.push_back(x / i);
}
}
}
sort(divs.begin(), divs.end());
return divs;
}
map<ll, ll> factors(ll n) {
map<ll, ll> fact;
while (n % 2 == 0) {
fact[2]++;
n /= 2;
}
for (ll i = 3; i * i <= n; i += 2) {
while (n % i == 0) {
fact[i]++;
n /= i;
}
}
if (n > 2) {
fact[n]++;
}
return fact;
}
ll lcm(ll a, ll b)
{
return a * (b / __gcd(a, b));
}
ll gcd(ll a, ll b) {
while (b != 0) {
ll temp = b;
b = a % b;
a = temp;
}
return a;
}
ll factorial(ll n) {
ll f=1;
while (n>0) {
f=f*n;
n--;
}
return f;
}
//const int mod=1e9+7;
double root(double x, double n) {
return pow(x, 1.0 / n);
}
void manar()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
bool is_even(int n) {
if((n&1)==0) {
return 1;
}
else {
return 0;
}
}
bool get_bit(ll n,int k) {
int msk=1LL<<k; //value
return (n&msk)? 1 : 0; //if value not =0 return true
}
int set_bit(ll n,int k) { // set k bit to 1
int msk=1LL<<k;
return n|msk;
}
int flip_bit(ll n,int i) {
int msk=1LL<<i;
return n^msk;
}
const int MOD=1e9;
ll fast_pow(long long n, long long k) {
long long result = 1;
while (k > 0) {
if (k & 1) {
result = (result * n) % MOD;
}
n = (n * n) % MOD;
k >>= 1;
}
return result;
}
ll count_ones(ll n) {
int cnt=0;
while (n) {
n=n&(n-1);
cnt++;
}
return cnt;
}
bool is_power_of_two(int n) {
if(n&&((n&n-1))==0) {
return 1;
}
else {
return 0;
}
}
vector<ll>sums;
vector<vector<ll>> gen_sub(ll n, vector<ll> arr) {
vector<vector<ll>> ans;
for (int i = 0; i < (1 << n); i++) {
vector<ll> tmp;
ll sum = 0;
for (int j = 0; j < n; j++) {
if (isON(i, j)) {
tmp.push_back(arr[j]);
sum += arr[j];
}
}
sums.push_back(sum);
ans.push_back(tmp);
}
return ans;
}
vector<string>sub(string s) {
vector<string> ans;
int n = s.size();
ans.push_back("");
for (int i = 1; i < (1 << n); ++i) {
string tmp = "";
for (int j = 0; j < n; ++j) {
if (i & (1 << j)) {
tmp += s[j];
}
}
ans.push_back(tmp);
}
return ans;
}
string get_binary(ll x)
{
string ret = "";
bool tmp = false;
for(int i = 63; i > -1; i--)
{
if(isON(x, i))
tmp = true;
if(tmp)
ret += to_string(isON(x, i));
}
return ret;
}
long long lowbit(long long x) {
return x & -x;
}
bool is_palindrome(string s) {
int l = 0, r = s.size() - 1;
while (l < r) {
if (s[l] !=s[r]) {
return false;
}
l++;
r--;
}
return true;
}
const int mod=1e9+7;
ll powmod(ll x, ll y, ll mod)
{
ll res = 1;
x = x % mod;
if (x == 0) return 0;
while (y > 0)
{
if (y & 1)
res = (res*x) % mod;
y = y>>1;
x = (x*x) % mod;
}
return res;
}
ll add(ll a,ll b)
{
return ((a%mod)+(b%mod))%mod;
}
ll mul(ll a,ll b)
{
return ((a%mod)*(b%mod))%mod;
}
ll sub(ll a,ll b)
{
return ((((a%mod)-(b%mod))%mod)+mod)%mod;
}
const int n = 1e6 + 1;
int divcnt[n + 1];
void cntDiv()
{
for(int i = 1; i <= n; i++)
{
for(int j = i; j <= n; j+= i)
divcnt[j]++;
}
}
const int N=1e7+10;
vector<bool> isPrime(N,true);
vector<int>v;
void sieve() {
isPrime[0] = false;
isPrime[1] = false;
for(ll i=2;i*i<N;i++)
{
if(isPrime[i])
{
for(ll j=i*i;j<N;j+=i)
{
isPrime[j] = false;
}
}
}
for (int i = 2; i < N; i++) {
if (isPrime[i]) {
v.push_back(i);
}
}
}
void manora() {
ll n, m, k;
cin >> n >> m >> k;
vector<vector<ll>> arr(m);
for (ll i = 0; i < n; ++i) {
for (ll j = 0; j < m; ++j) {
ll x;
cin >> x;
arr[j].push_back(x);
}
}
for (ll j = 0; j < m; ++j) {
sort(arr[j].rbegin(), arr[j].rend());
}
priority_queue<ll> pq;
for (ll j = 0; j < m; ++j) {
for (ll i = 0; i < min(n,j+1); ++i) {
pq.push(arr[j][i]);
}
}
if (k == 0) {
cout << 0 << endl;
return;
}
long double sum = 0;
while (k >= 0 && !pq.empty()&&pq.top()>0) {
sum += pq.top();
pq.pop();
k--;
}
cout << sum << endl;
}
int main() {
manar();
manora();
/* int t;
cin>>t;
while (t--) {
manora();
}
*/
return 0;
}