#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define BIL ((ll)1e9)
#define MOD ((ll)1e9+7)
#define INF (1LL<<60)           //1LL<<63でオーバーフロー
#define inf (1<<29)             //1<<29でオーバーフロー

int main(int argc,char* argv[]){
    int a,b;
    cin >> a >> b;

    int plug=1;
    int tap=0;
    while(plug<b){
        tap++;
        plug=plug-1+a;
    }

    cout << tap << endl;

    return 0;
}

#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N, M;
  cin>>N>>M;
  int arr[N+1];
  for(int i=0;i<=N;++i) arr[i] = 0;
  int L, R;
  for(int i=0;i<M;++i) {
    cin>>L>>R;
    L--;
    arr[L]++;
    arr[R]--;
  }
  for(int i=1;i<=N;++i) arr[i] += arr[i-1];
  int ans = 0;
  for(int i=0;i<=N;++i) {
    if(arr[i]==M) ans++;
  }
  cout<<ans<<endl;
}

