#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;
ll MOD=1000000007;
int main(){
 ll a,b;
  cin>>a>>b;
  ll d=b-a;
  ll ans=1;
  rep2(i,1,d+1){
    if(a%i==0&&i*(a/i+1)<=b&&i>ans) ans=i;
 else if(a%i!=0&&a<=i*(a/i+1)&&i*(a/i+2)<=b&&i>ans) ans=i;
  }
  cout<<ans;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define __hh__ ios_base::sync_with_stdio(false); cin.tie(0);
#define ll long long
#define all(x) (x).begin(),(x).end()
#define vi vector<int>
#define vl vector<long long>
#define vs vector<string>
#define vd vector<double>
#define vb vector<bool>
#define vc vector<char>
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define vvs vector<vector<string>>
#define vvc vector<vector<char>>
#define mii map<int,int>
#define msi map<string,int>
#define rep(i,n) for(int i=0; i<n; i++)
#define repr(i,s,n) for(int i=s; i<n ;i++)
#define repl(i,n) for(ll i=0; i<n; i++)
#define reprl(i,s,n) for(ll i=s; i<n ;i++)
#define print(x) cout << x << "\n"
const double PI=3.14159265358979323846;
const int INF=20e8;
const ll INFL=92e12;


int main() {
  __hh__

  int n, k;
  cin >> n >> k;
  int ans = 0;
  repr (i, 1, n+1) repr (j, 1, k+1) ans += i*100+j;
  cout << ans << "\n";


}
