#include<iostream>
#include<cstdio>
using namespace std;
int n,m,x1[4]={0,0,1,-1},y1[4]={1,-1,0,0};
char island[13][13];
int serch(int x,int y)
{
    island[x][y]='0';
    for(int i=0;i<4;i++){
        int x2=x+x1[i],y2=y+y1[i];
        if(x2>=0&&x2<=11&&y2>=0&&y2<=11&&island[x2][y2]=='1')serch(x2,y2);
    }
    //cout<<"end\n";
}
int main(void)
{
    int A=0;
    while(1){
            A=0;
    for(int i=0;i<12;i++){
           if(scanf("%s",island[i])==EOF)goto end1;
    }
    for(int i=0;i<12;i++){
        for(int j=0;j<12;j++){
            if(island[i][j]=='1'){
               // cout<<"str\n";
                serch(i,j);
                A++;
            }
        }
    }
    cout<<A<<"\n";
    }
    end1:;
}
# include <bits/stdc++.h>
# define sz(x) (int)((x).size())
# define F first
# define S second
# define pb push_back
# define ub upper_bound
# define lb lower_bound
# define all(x) x.begin(), x.end()
# define pqueue priority_queue
# define mset multiset
# define umap unordered_map
# define Speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
# define rep(i,n) for(int i=0;i<n;++i)
# define forn(i,n) for(int i=1;i<=n;++i)
# define lr(i,l,r) for(int i=l;(l>r?i>=r:i<=r);(l>r?--i:++i))

using namespace std;

template<class T> void umin(T &a, T b) { a = min(a, b); }
template<class T> void umax(T &a, T b) { a = max(a, b); }

typedef long long ll;
typedef pair<int, int> pii;

const int mod = 1e9+7;
const int N = 2e5+5;

void solve(){
	int a,b;
	cin>>a>>b;
	if(b==1){
		cout<<0;
	}
	else{
		int ans=1;
		int cur=a;
		while(cur<b){
			int prev=cur;
			for(int i=1;i<=prev && cur<b;++i){
				cur--;
				cur+=a;
				ans++;
			}
		}
		cout<<ans;
	}

}

int main(){
	Speed();
	int T=1; 
	//cin>>T;	
	while(T--)
		solve();
	return 0;
}