#include<bits/stdc++.h> using namespace std; int main() { int x,y; cin>>x>>y; for(int i=1000;1>=2;i--){ if(i%x!=0&&i%y!=0){ cout<<i; return 0; } } }