#include <stdio.h>

#define finput(a, b, c) do { fscanf(fstdin, "%lld %lld %lld", &a, &b, &c); } while(0)
#define fast(s, c) do { setvbuf(s, c, _IOFBF, 1 << 20); } while(0)

char cinput[1 << 20];
char coutput[1 << 20];

FILE* fstdin = NULL;
FILE* fstdout = NULL;

long long a,b,c,m,d;

long long gcd(long long a, long long b) {
    return b == 0 ? a : gcd(b, a % b);
}

long long lcm(long long a, long long b) {
    return (a / gcd(a, b)) * b;
}

int main(int argc, char* argv[], char* envp[]) {
    fstdin = fopen("SMARTKEY.INP", "r");
    if (fstdin == NULL) return 0;
    
    fstdout = fopen("SMARTKEY.OUT", "w");
    if (fstdout == NULL) {
        fclose(fstdin);
        return 0;
    }
    
    fast(fstdin, cinput);
    fast(fstdout, coutput);
    
    finput(a, b, c); m = a+b+c;
    finput(a, b, c); d = a+b+c;
    
    fprintf(fstdout, "%lld", lcm(m, d));
    
    fclose(fstdin);
	fflush(fstdout);
    fclose(fstdout);
    return 0;
}
