/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <stdio.h>
int main()
{
int n,m,temp=0;
scanf("%d %d",&n,&m);
if(n<m){
for(int i=0; i<n; i++){
temp=temp+m;
}
}
else{
for(int i=0; i<m; i++){
temp=temp+n;
}
}
printf("%d",temp);
}