#include <iostream>
#include <vector>

using namespace std;

int main()
{
	
	int  n, m , k, count = 0;
	cin >> n >> m >> k;
	
	vector <vector <int> > a(n, vector <int> (m, 0)); 
	
    	for(int i = 0; i < n; i += k)
    	{
		
	    	for(int j = 0; j < m; j += k)
	    	{
		    	if(k/2 + 1 +i < n && k/2 + 1+ j< m)
		    		a[k/2 + 1+ i][k/2 + 1+ j] = 2;
		    	else if(k/2 + 1+ i < n)			
		    		a[k/2 + 1+ i][m - 1] = 2;
	    		else if(k/2 + 1+ j< m)			
	    			a[n - 1][k/2 + 1+ j] = 2;
	    		else
	    			a[n - 1][m - 1] = 2;
	    	}
		
    	}
	
    	for(int i = 0; i < n; i++)
    	{
	    	for(int j = 0; j < m; j++)
	    	{
	    		if(a[i][j] == 2) count++;
	    	}
	    }
	if(k == 1){
		count = n * m;
	}
	cout << count;
		
}
