#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <bits/stdc++.h>
#include <time.h>
#include <stack>
#include <array>



#define popcount __builtin_popcount
using namespace std;

#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define rrep(i,x) for(long long i=x-1;i>=0;i--)
#define rrepn(i,x) for(long long i=x;i>1;i--)
#define REP(i,n,x) for(long long i=n;i<x;i++)
#define REPN(i,n,x) for(long long i=n+1;i<x;i++)

#define re return
#define fi first
#define se second
#define pr printf
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }

#define all(x) (x).begin(),(x).end()

typedef long long int ll;

const double PI=3.14159265358979323846;
//#define INF 1e18+5//19桁
#define INF 9223372036854775807
//-9,223,372,036,854,775,808~9,223,372,036,854,775,807
//-9223372036854775808~9223372036854775807

#define inf  INT_MAX//19桁
//#define mp make_pair
//using lll=__int128_t;

const ll mask=(1<<20)-1;
typedef pair<long long, long long> P;


//int dp[MAX][MAX];
const int MAX = 500;
const int MOD = 1000000007;
//#define MAX 105
ll wk,wk1,wk2,wk3,wk4;
double dA,dB,dC,dD,dE,dF,dG,dH,dI,dJ,dK,dL,dM,dN,dO,dP,dQ,dR,dS,dT,dU,dV,dW,dX,dY,dZ;
double dwk,dwk1,dwk2,dwk3,dwk4,dsum;
ll A,B,C,D,E,F,G,I,J,K,L,M,N,O,R,S,T,U,V,X,Y,Z;//P,Q,H,Wは無し
//ll a,b,c,d,e,f,g,i,j,k,l,m,n,o,r,s,t,u,v,x,y,z;//p,q,h,wは無し
ll cnt,flg;
ll ans,sum=0;
//int n;
//int t[200020];
//int a[200020], b[200020];

//vector<ll> A[MAX];
//int ans[200020];

//#define mod 1000000007//atcoder/allを使う時にはコメントアウト
//#define mod 998244353//atcoder/allを使う時にはコメントアウト

//g++ new_formatcopy.cpp -std=c++14 -I /mnt/c/code/
//もしくはexport CPATH=$CPATH:/mnt/c/code/

//**************ここまでフォーマット***************



int main(){	
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll max=0;
    ll min=INF;


    cin>>A>>B;
    if(A==1){
        cout<<2*B;
    }
    else{
        cout<<-B/(A-1);
    }
}