#include<iostream>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if (a% d == 0 && b % d == 0 && c % d == 0) {//判斷是否三個數都可以整除
int count = (a / d) * (b / d) * (c / d);//count是指算數
cout << count << endl;
} else {
cout << 0 << endl; //不能整除就0
}}