https://www.acmicpc.net/problem/1145
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner s= new Scanner(System.in);
int[] arr=new int[5];
for(int j=0;j<5;j++){
int n=s.nextInt();
arr[j]=n;
}
int t=0;
int num=0;
while(true){
num++;
for(int i=0;i<5;i++){
if(num>=arr[i] && num%arr[i]==0) t++;
}
if(t>2) break;
t=0;
}
System.out.print(num);
}
}