#include<bits/stdc++.h>
using namespace std;


int main(){
  int W,H,C;

  cin >> W >> H >> C;

  int size = 1;
  int result_size = 0;
  int num = 0;
  while(true){

    if(size > W || size > H) {
      break;
    }
    
    if(W % size == 0 && H % size == 0){
      result_size = size;
      num = (W / result_size) * (H / result_size);
    }
    
    ++size;
  }

  cout << num * C << endl;
  
  return 0;
}

