program pil_11_54(input,output);  
const
  N = 5;
var
  num : array [1..N] of integer;
  last : 0..N;
  i : integer;

function NOD(x,y : integer) : integer;
begin
  while (x<>0)and(y<>0) do
    if x>=y then x := x mod y
    else y := y mod x;
  NOD := x+y;
end;

begin
  Write('Input numbers : ');
  for i:=1 to N do read(num[i]);
    
  last := N;
  While last>1 do begin
    for i:=1 to last div 2 do
      num[i] := num[2*i-1]*num[2*i] div NOD(num[2*i-1], num[2*i]);
    if last mod 2 = 1 then begin
      num[last div 2 + 1] := num[last];
      last := last div 2 + 1;
    end
    else last := last div 2;
  end;

  WriteLn('The result is ', num[1]);
end.
