#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define int long long
#define F first
#define S second
#define all(x, n, c) sort( x + c, x + n + c )
#define allv(x) sort( x.begin(), x.end() )
#define rev(x, n, c) reverse( x + c, x + n + c )
#define revv(x) reverse( x.begin(), x.end() )
#define sz(x) (x).size()
#define nl "\n"
#define IAmTheOneWhoKnocks ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

bool f( int n, int m, int k, int x )
{
    if( k * x * k * x >= n * m )
    {
        return 1;
    }
    else
    {
        return 0;
    }
}

void solve()
{
    int n, m, k;
    cin >>n >>m >>k;
    int l = 0, r = max(n, m) * 1000;
    while( r - l > 1 )
    {
        int mid = (l + r) / 2;
        bool ch = f(n, m, k, mid);
        if( ch )
        {
            r = mid;
        }
        else
        {
            l = mid;
        }
    }
    cout <<r * 2;
    return;
}

signed main()
{
    IAmTheOneWhoKnocks
    int T = 1;
    //cin >>T;
    while( T-- )
    { solve(); }
    return 0;
}
