#include <stdio.h>
long int xx,a,b;
char x[20000],y[20000],z[20000];
int getCifra(char *a, int i){
if (i>a[0])
return 0;
else
return a[i];
}
long int cmmdc(long int a, long int b) {
long int r;
while (b!=0) {
r = a % b;
a=b;
b=r;
}
return a;
}
void suma(char *a, char *b, char *c) {
long int t = 0,max;
max = a[0];
if (max<b[0]) max=b[0];
for (int i=1;i<=max;i++) {
int aux = getCifra(a,i)+getCifra(b,i)+t;
c[i]=aux%10;
t=aux/10;
}
if (t==1) {
c[0]=max+1;
c[max+1]=1;
} else {
c[0]=max;
}
}
void mul(char *a, int b, char *c) {
long int t = 0,max;
max = a[0];
// if (max<b[0]) max=b[0];
for (long int i=1;i<=max;i++) {
int aux = getCifra(a,i)*b+t;
c[i]=aux%10;
if (c[i]>1) {
c[0]=i;
return;
}
t=aux/10;
}
c[0]=max;
while (t!=0) {
c[0]++;
c[c[0]]=t%10;
t=t/10;
}
}
int verif01(char *a){
int i;
for (i=1; i<=a[0]; i++) {
if (a[i]>1)
return 0;
}
return 1;
}
void atrib(char *a,char *b){
for (int i=0;i<=b[0];i++) {
a[i]=b[i];
}
}
int main(){
int n,i;
/* x[0]=3;
x[1]=0;
x[2]=0;
x[3]=1;*/
FILE *f = fopen("multiplu.in","r");
fscanf(f,"%ld %ld",&a, &b);
fclose(f);
x[0]=0;
xx=a*b/cmmdc(a,b);
/* xx ->1 term 1, 0
2 5, 0
3 7, 0
4 5, 0
5 2, 4, 6, 8, 0
6 5, 0
7 1, 0
8 5, 0*/
int uc = xx/10;
while (xx!=0) {
x[0]++;
x[x[0]]=xx%10;
xx/=10;
}
// unu[0]=unu[1]=1;
i=2;
atrib(z,x);
while (!verif01(x)){
// suma(x,unu,y);
mul(z,i,x);
// atrib(x,y);
i++;
}
FILE *g = fopen("multiplu.out","w");
for (i=x[0];i>0;i--){
fprintf(g,"%d",x[i]);
}
fclose(g);
return 0;
}