"use strict";
const Main = (input) =>{
   let xs = input.split("\n");
   let xs1 = xs[0].trim().split(' ').map(v=>parseInt(v,10));
　 let N = xs1[0]; 
   let r = 0;
   let d = 0;
   let ans = [];

   for(let i=1; i<N; i++){
        let x = xs[i];
        let y = xs[i+1];
        let n = xs[i];
        let m = xs[i+1]
        	while (n > 0) {
        		let r = m % n; 
        		m = n;     
        		n = r;     
        	}
        	d = m;
        
            ans.push(x*y/d);
   }
   console.log(Math.max.apply(null, ans));
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


