#include<bits/stdc++.h>
using namespace std;

int kadamba(double arr[][100],int i,int j,double t,int n)
{
		arr[i][j]+=t;arr[i][j+1]+=t;
		if(arr[i][j]>1)
		{
			if(i+1<n)
			{
				kadamba(arr,i+1,j,(arr[i][j]-1)/2,n);arr[i][j]=1;
			}
			else
			{

			}
		}
		if(arr[i][j+1]>1)
		{
			if(i+1<n)
			{
				kadamba(arr,i+1,j+1,(arr[i][j+1]-1)/2,n);arr[i][j+1]=1;
			}
			else
			{

			}
		}
}

int main()
{
int n;double t;
cin>>n>>t;
double arr[n][100];for(int i=0;i<n;i++){for(int j=0;j<100;j++){arr[i][j]=0;}}

int i=1;int j=0;int ans=0;
if(t==0){cout<<"0";
goto y;
}
/*if(t>=((n+1)*n)/2)
{
	cout<<(n*(n+1))/2;
	goto y;
}*/
if(n!=1)
{
kadamba(arr,i,j,(t-1)/2,n);
}

for(int i=0;i<n;i++)
{
	for(int j=0;j<n+1;j++)
	{
		if(arr[i][j]>=1)
		{
			ans++;
		}
	}

}
cout<<ans+1;
y:
return 0;
}

#include <bits/stdc++.h>
using namespace std;
struct node{
        int le, ri;
        double val;
        node(){ val = 0, le = -1, ri = -1; }
};
vector<node> tree(10000, node());
bool vis[10000];
int n, t, MAX_POS;
int ans = 0;
void inc(int pos, double val)
{
        if (pos > MAX_POS || pos < 1) return;
        tree[pos].val += val;
        if (tree[pos].val >= 100.0 && !vis[pos])
                ans++, vis[pos] = 1;
        if (tree[pos].val > 100.0)
        {
                int diff = tree[pos].val - 100.0;
                tree[pos].val = 100.0;
                inc(tree[pos].le, diff / 2);
                inc(tree[pos].ri, diff / 2);
        }
}
int main(void)
{
        scanf("%d%d", &n, &t);
        MAX_POS = (n + 1) * n / 2;
        int base = 1, num = 1;
        for(int level = 1; level < n; level++)
        {
                tree[base].le = ++num;
                for(int i = base; i - base < level; i++)
                {
                        tree[i].ri = ++num;
                        if (i - base + 1 < level)
                                tree[i + 1].le = num;
                }
                base += level;
        }
        inc(1, 100.0 * t);
        printf("%d", ans);
        return (0);
}

//http://codeforces.com/problemset/problem/676/B

#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <list>

using namespace std;

#define pii pair <int, int>
#define vvi vector <int>
#define ll long long

int size_n, size_k;
double cur[20][20];
int result = 0;

int main()
{
	int ii, jj, kk;
	long double tmp;

	cin >> size_n >> size_k;

	for (ii = 0; ii < 20; ii++)
	{
		for (jj = 0; jj < 20; jj++)
			cur[ii][jj] = 0;
	}

	cur[0][0] = double(size_k);

	for (ii = 0; ii < size_n; ii++)
	{
		for (jj = 0; jj <= ii; jj++)
		{
			if ((cur[ii][jj] + 1e-12) >= 1.0)
				result++;

			tmp = (cur[ii][jj] - 1) > 0 ? (cur[ii][jj] - 1) : 0;

			cur[ii + 1][jj] += tmp * 0.5;
			cur[ii + 1][jj + 1] += tmp * 0.5;
		}
	}

	cout << result << endl;

	return 0;
}

#include<cstdio>
#include<cstring>
const int MAX_N = 15;
int num[MAX_N][MAX_N];
const int all = 1 << 10;
void solve(){
    int n,t;
    while(scanf("%d %d",&n,&t)==2){
        int ans = 0;
        memset(num,0,sizeof(num));
        num[0][0] = t * all;
        for(int i = 0;i < n;++i)
            for(int j = 0;j <= i;++j){
                if(num[i][j] >= all){
                    ++ans;
                    int tmp = num[i][j] - all;
                    num[i+1][j] += (tmp >> 1);
                    num[i+1][j+1] += (tmp >> 1);
                }
            }
        printf("%d\n",ans);
    }

}
int main(){
    solve();
    return 0;
}
/*2016-05-30 10:10:34.917*/

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    long double t;
    cin>>n>>t;
    long double arr[n*(n+1)/2]={0};
    int u=0;
    int ans=0;
     arr[u]=t;
     if(t>=1)
     {for(int x=1;x<=n;x++)
    {
        for(int y=1;y<=x;++y,++u)
        {
           t=arr[u];
           if(t==1.0f)
           {
               ++ans;
           }
           else if(t>1)
           {   ++ans;
               if(u+x<=((n)*(n+1)/2))
               {arr[u+x]=arr[u+x]+(t-1)/2;}
                if(u+x+1<=((n)*(n+1)/2))
               arr[u+x+1]=arr[u+x+1]+(t-1)/2;
           }
        }
    }}
    cout<<ans;
}

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i = 0; i < n; ++i)
#define Rep(i,n) for(int i = 1; i <= n; ++i)
#define lowbit(x) ((x)&(-x))
//#pragma comment(linker,"/STACK:1024000000,1024000000")
#define eps 1e-6
#define sqr(x) ((x)*(x))
#define pb(x) push_back(x)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;

const int inf = 0x3f3f3f3f, mod = 1e9 + 7;
const int maxn = 2e5 +100;
const ld PI = acos(-1.0);
ll gcd (ll a, ll b)
{return ( a ? gcd(b%a, a) : b );}
ll power(ll a, ll n)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power(ll a, ll n, ll mod)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;}
int n,m,all,k;
double flag[maxn];
int dd[maxn];
int main()
{
    int kase=1;
    int t;
    while(~scanf("%d%d",&n,&m))
    {
        memset(flag,0,sizeof flag);
        int g=n*(n+1)/2;
        int nex=2;
       for(int i=1;i<=m;i++)
       {
           flag[1]+=1.0;
           for(int j=1;j<=g;j++)
            if(flag[j]>1)
           {
               int sum=0,gg;
               for(int s=1;s<=n;s++)
                if(sum+s>=j)
               {
                   gg=s;break;
               }
               else sum+=s;
               flag[gg+j]+=(flag[j]-1.0)/2.0;
               flag[gg+j+1]+=(flag[j]-1.0)/2.0;
               flag[j]=1.0;
               //cout<<gg<<endl;
           }
       }
       int cun=0;//cout<<flag[5]<<endl;
       for(int j=1;j<=g;j++)
        if(flag[j]>=1.0)
        cun++;
       cout<<cun<<endl;
    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define NMAX 105

double ma[15][15];
int n,m;

int main()
{
    cin>>n>>m;

    int sol = 0;
    ma[0][0] = m;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<=i;j++)
        {
            if(ma[i][j] >= 1.0)
            {
                double surplus = (ma[i][j] - 1.0) * 0.5;
                ma[i+1][j] += surplus ;
                ma[i+1][j+1] += surplus ;
                sol++;
            }
        }
    }
    cout<<sol;

    return 0;
}

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

double dp[11][11];

int main(){
	int n,t,i,j;
	int count;
	while(~scanf("%d%d",&n,&t)){
		count = 0;
		memset(dp,0,sizeof(dp));
		dp[1][1] = t;
		for(i = 1;i <= n;i++)
			for(j = 1;j <=i;j++)
				if(dp[i][j]>=1){
					count++;
					dp[i+1][j]+=(dp[i][j]-1)/2.0;
					dp[i+1][j+1]+=(dp[i][j]-1)/2.0;
				}
		printf("%d\n",count);
	}
	return 0;
}

#include<cstdio>
#include<iostream>
using namespace std;
int v[13][13];
int main(void)
{
     int n,t;
     cin >> n >> t ;
     int ans = 0;
     int m = (1 << n);
     v[1][1] = t * m;
     for(int i = 1 ; i <= n ; i++)
     {
          for(int j = 1 ; j <= i ; j++)
          {
               if(v[i][j] >= m)
               {
                    ans++;
                    v[i][j] -= m;
               }
               else
                    v[i][j] = 0;
               v[i+1][j] += v[i][j]/2;
               v[i+1][j+1] += v[i][j]/2;
          }
     }
     cout << ans << endl ;
     return 0;
}

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<string>
#include<bitset>
#include<utility>
#include<functional>
#include<iomanip>
#include<sstream>
#include<ctime>
using namespace std;

#define maxn int(1e5+50)
#define inf int(0x3f3f3f3f)
#define mod int(1e9+7)
#define PI acos(-1.0)
typedef long long ll;

int n,t;
double a[100];
void dfs(int s, int res,int p)
{
	if(res > ((n+1)*n)/2) return;
	if(a[res] < 1 && p > 0){
		a[res] += 1.0/pow(2.0,s);
		p -= 1.0/pow(2.0,s);
		if(p <= 0) return;
	}
	dfs(s+1, res + s+1, p);
	dfs(s+1, res + s+2, p);
}
int main()
{
#ifdef CDZSC_June
	freopen("t.txt", "r", stdin);
#endif
	while(~scanf("%d%d",&n,&t))
	{
		memset(a,0,sizeof(a));
		for(int i = 0; i<t; i++){
			dfs(0,1,1);
		}
		int sum = 0;
		for(int i = 1; i<=((n+1)*n)/2; i++)
		{
			if(a[i] == 1){
				sum++;
			}
		}
		printf("%d\n",sum);
	}
	return 0;
}

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

int main(){
	int n,t,i,j;
	int count;
	double dp[12][12];
	while(~scanf("%d%d",&n,&t)){
		count = 0;
		memset(dp,0,sizeof(dp));
		dp[1][1] = t;
		for(i = 1;i <= n;i++)
			for(j = 1;j <=i;j++)
				if(dp[i][j]>=1){
					count++;
					dp[i+1][j]+=(dp[i][j]-1)/2.0;
					dp[i+1][j+1]+=(dp[i][j]-1)/2.0;
				}
		printf("%d\n",count);
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int n, t, sum = 0;
double dp[13][13];

int main(){

    scanf("%d %d", &n, &t);

    dp[0][0] = t;

    for (int i = 0; i < n; i++){
        for (int j = 0; j <= i; j++){

            if (dp[i][j]+1e-10 >= 1)
                sum++;
            double x = max((double)0, dp[i][j] - 1);
            dp[i + 1][j] += x * 0.5;
            dp[i + 1][j + 1] += x * 0.5;
        }
    }

    printf("%d\n", sum);

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define DRI(x) int x; cin >> x;
#define DRII(x, y) int x, y; cin >> x >> y;
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define pii pair<int, int>
#define PB push_back
#define MP make_pair
#define X first
#define Y second
#define D(x) cout << " ->"#x": " << x << endl;
const double eps = 1e-12;

double T[20][50];

int rec( int p, int b, double val ){
	T[p][b] += val;
	if(T[p][b] + eps > 1.){
		val = T[p][b] - 1.;
		T[p][b] = 1.;
	} else {
		val = 0.;
	}
	if(p <= 10 && val > eps){
		rec(p+1, b+1, .5*val);
		rec(p+1, b-1, .5*val);
	}
}

int main(){
	DRII(n, t);
	int res = 0;
	int mx = n*(n+1)/2;

	rec( 0, 25, t);
	FOR( i, 0, n ){
		FOR( j, 0, 50){
			if( T[i][j] + eps > 1 )
				res ++;
		}
	}
	cout << min(mx, res) << endl;
}

#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define ull unsigned ll
#define all(x) x.begin(), x.end()
typedef vector<ll> vll;
typedef vector<int> vi;
const int N = 1e6 + 20;
const ll M = 1e9 + 7;

int main() {
    int n, t;
    cin >> n >> t;

    int a[n + 1][n + 1];
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= n; ++j) {
            a[i][j] = 0;
        }
    }
    int b[n];
    for (int k = 0; k < n; ++k) {
        b[k] = 1 << k;
    }
    for (int i = 1; i <= t; ++i) {
        int inc[n + 1][n + 1];
        memset(inc, 0, sizeof(inc));
        inc[0][0] = 1;
        for (int j = 0; j < n; ++j) {
            for (int k = 0; k <= j; ++k) {
                if (inc[j][k]) {
                    if (a[j][k] + inc[j][k] >= b[j]) {
                        inc[j + 1][k] += a[j][k] + inc[j][k] - b[j];
                        inc[j + 1][k + 1] += a[j][k] + inc[j][k] - b[j];
                        a[j][k] = b[j];
                    } else
                        a[j][k] += inc[j][k];
                }

            }
        }
    }
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j <= i; ++j) {
            if (a[i][j] == b[i])
                ans++;
        }
    }
    cout << ans << endl;
}

#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int MAX_N=11;
double x[MAX_N][MAX_N];
void rec(int i, int j, long double t,int n)
{
	if (x[i][j]<1)
	{
		if (t>=(1-x[i][j]))
		{
			t-=(1-x[i][j]);
			x[i][j]=1.0;
			if (i+1<n)
			{
				rec (i+1,j+1,t/2.0,n);
				rec (i+1,j,t/2.0,n);
			}
		}
		else
			x[i][j]+=t;
	}
	else
	{
		if (i+1<n)
		{
			rec (i+1,j+1,t/2.0,n);
			rec (i+1,j,t/2.0,n);
		}
	}
}
int main ()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n,ans=0;
	long double t;
	cin>>n>>t;
	for (int i=0;i<n;i++)
		for (int j=0;j<n;j++)
			x[i][j]=0;
	rec (0,0,t,n);
	for (int i=0;i<n;i++)
	{
		for (int j=0;j<=i;j++)
		{
			if (!(x[i][j]<1))
				ans++;
		}
	}
	cout<<ans;
	return 0;
}

#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
using namespace __gnu_pbds;

#define f(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
#define flush fflush(stdout)
#define primeDEN 727999983
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// find_by_order()  // order_of_key
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

int a[123456],b[123456];
#define SPEED ios_base::sync_with_stdio(false) ;cin.tie(NULL) ;cout.tie(NULL) ;
#define fp(i,a,n) for(ll i=n-1; i>a ;i--)
#define deb(x) cout << #x << " ---> " << x << endl;
#define X first
#define Y second
#define pia 3.1415926536
#define mo 100003
template<typename T>
class custom_priority_queue : public std::priority_queue<T, std::vector<T>>
{
  public:

      bool remove(const T& value) {
        auto it = std::find(this->c.begin(), this->c.end(), value);
        if (it != this->c.end()) {
            this->c.erase(it);
            std::make_heap(this->c.begin(), this->c.end(), this->comp);
            return true;
       }
       else {
        return false;
       }
 }
};
int main()
{
ll n,t,cnt =0 ,sub=1 ,sum =1 ,index =1;
cin>>n>>t ;
f(i,0,n) sub *= 2 ;
ll total = t*sub ;
vector<vector<ll> > v(n,vector<ll>(n,0)) ;
v[0][0] = t*sub ;

f(i,0,n-1)
{
f(j,0,i+1)
{
	 if(v[i][j]>= sub) {cnt++ ;v[i+1][j] +=(v[i][j]-sub)/2;v[i+1][j+1] +=(v[i][j]-sub)/2 ;}
}
}
f(i,0,n) {if(v[n-1][i] >=sub) cnt++ ;}

cout<<cnt<<endl ;
}

#include<bits/stdc++.h>
using namespace std;

void fill(int i, int j, double val, double **matrix, int N)
{
	if(i<0 || i>=N || j<0 || j>=N)
	{
		return;
	}

	if(matrix[i][j]==1)
	{
		fill(i+1, j, val/2, matrix, N);
		fill(i+1, j+1, val/2, matrix, N);

		return;
	}

//	if(matrix[i][j]+val<=1)
//	{
//		matrix[i][j]+=val;
//		return;
//	}

	matrix[i][j]+=val;
	if(matrix[i][j]>1)
	{
		double over=matrix[i][j]-1;
		matrix[i][j]=1;
		fill(i+1, j, over/2, matrix, N);
		fill(i+1, j+1, over/2, matrix, N);

		return;
	}
}

int glasses_wine(int n, double t)
{
	double **matrix =new double*[n];
	for(int i=0;i<n;i++)
	{
		matrix[i]=new double[n];
		for(int j=0;j<n;j++)
		{
			matrix[i][j]=0;
		}
	}

	fill(0, 0, t, matrix, n);
	int ans=0;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			//cout<<matrix[i][j]<<" ";
			if(matrix[i][j]>=1)
			{
				ans++;
			}
		}
		cout<<endl;
	}

	return ans;
}
int main()
{
	double n,t;
	cin>>n>>t;
	int ans=glasses_wine(n,t);

	cout<<ans<<endl;
}

#include <math.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <map>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <vector>

#define fi "b.inp"
#define fo "b.out"

using namespace std;

int n,t;
double d[15][15];

void solve(){

	int i,j,da;
	double x;
	da=0;

	for(i=1;i<=10;i++) memset(d[i],0,sizeof(d[i]));
	d[1][1]=t;

	for(i=1;i<=n;i++){

		for(j=1;j<=i;j++){

			if(d[i][j]<=1) continue;

			x=d[i][j]-1;

			d[i][j]=1;
			d[i+1][j]+=x/2;
			d[i+1][j+1]+=x/2;
		}
	}

	for(i=1;i<=n;i++){

		for(j=1;j<=i;j++){
			if(d[i][j]==1) da++;
		}
	}

	cout<<da<<endl;
}

int main(){

	//freopen(fi,"r",stdin);
	//freopen(fo,"w",stdout);

	while(cin>>n>>t) solve();

	return 0;
}

#include <iostream>
#include<string.h>
#include<stdlib.h>
#include<iomanip>
#include<algorithm>
#include<cmath>
using namespace std;
int n, t,s;
double a[11][11];
int main(){
	cin >> n >> t;
	for (int x = 0; x < t; x++){
		a[0][0]+=1.0;
		for (int i = 0; i < n; i++){
			for (int j = 0; j < i + 1; j++){
				if (a[i][j] > 1.0){
					a[i + 1][j] += (a[i][j] - 1.0) / 2.0;
					a[i + 1][j+1] += (a[i][j] - 1.0) / 2.0;
					a[i][j] = 1;
				}
			}
		}
	}
	for (int i = 0; i < n; i++){
		for (int j = 0; j < i + 1; j++){
			if (a[i][j] == 1.0){
				s++;
			}
		}
	}
	cout << s;
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <fstream>
#include <list>
#include <set>
#include <climits>
#include <map>
#include <stack>
#include <queue>
#include <complex>
#include <cmath>
#include <sstream>
#include <deque>
#include <utility>
#include <bitset>
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define PI 3.1415926535897932384626433832
#define MOD 1000000007
using namespace std;
string to(int a )
{
    string s ="";
    while(a!=0)
    {
        s+=char(a%10+'0');
        a/=10;
    }
    string t = "";
    for(int i = s.size()-1; i>=0; i--)
    {
        t+=s[i];
    }
    return t;

}
/*

    for(int i = 0;i<n;i++){

    }

*/
vector<int> b;
vector<vector<int> > a;

void solve(){
    a[1][0]+=1;
for(int i = 1;i<=10;i++){
    bool is = true;
    for(int j = 0;j<a[i].size();j++){
        if(a[i][j]>pow(2,i-1)){
                int k = a[i][j]-pow(2,i-1);
            a[i][j]=pow(2,i-1);

            a[i+1][j]+=k;
            a[i+1][j+1]+=k;
            is = false;
        }

    }
    if(is)return;

}

}

int main(){

    ll n,t;
    cin>>n>>t;
a.push_back(b);

for(int i = 0;i<=11;i++){
    b.push_back(0);
    a.push_back(b);

}
for(int i = 0;i<t;i++){
    solve();

}
int cou = 0;
for(int i = 1;i<=n;i++){
    for(int j = 0;j<a[i].size();j++){
        if(a[i][j]==pow(2,i-1))cou++;
    }
}

 cout<<cou;
}

#include <iostream>
#include <fstream>
#include<string>
#include<unordered_map>
#include<map>
#include<deque>
#include<algorithm>
#include<math.h>

using namespace std;

int main(){
	int N, T;
	cin >> N >> T;
	vector<pair<int, int>> row;
	for (int i = 0; i < N + 1; i++){

		for (int j = 0; j <= i; j++){
			row.push_back(make_pair(i, j));

		}

	}
	int n = row.size()-N-1;
	double val[3000] = { 0.0 };
	double added[3000] = { 0.0 };

	map<int, pair<int, int>> d;
	map<pair<int, int>, int> dr;

	for (auto i = 0; i < row.size(); i++){
		d[i] = row[i];
		dr[row[i]] = i;

	}

	for (int t = 0; t < T; t++){
		added[0] = 1.0;
		for (int i = 0; i < n; i++){
			auto rem = max(0.0, added[i] + val[i] - 1.0);
			val[i] = min(1.0, added[i] + val[i]);
			auto z = d[i];
			auto j = dr[make_pair(z.first + 1, z.second)];

			added[j] = added[j] + rem / 2;
			added[j + 1] = added[j + 1] + rem / 2;
			added[i] = 0;

		}

	}

	auto cnt = 0;
	for (int i = 0; i < n; i++)
		if (val[i] == 1.0) cnt = cnt + 1;

	cout << cnt << endl;

	return 0;
}

#include<stdio.h>
#include <math.h>
double cap[20][20];
void f(int row,int col)
{
	if(row>10 || col>19)
		return;
	cap[row+1][col-1]+=pow(0.5,row);
	if(cap[row+1][col-1]>1)
		f(row+1,col-1);
	cap[row+1][col+1]+=pow(0.5,row);
	if(cap[row+1][col+1]>1)
		f(row+1,col+1);

	return;
}
int main()
{
	int n,t;
	int num;
	int cnt=0;
	int i,j,k,p;
	scanf("%d%d",&n,&t);
	for(i=1;i<=t;++i)
	{
		cap[1][10]+=1;
		if(cap[1][10]>1)
			f(1,10);
	}
	for(i=1;i<=n;++i)
		for(j=1;j<=19;++j)
			if(cap[i][j]>=1)
				cnt++;
	printf("%d\n",cnt);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
#define mp make_pair
#define mt make_tuple
#define one(x) memset(x,1,sizeof(x))
#define zero(x) memset(x,0,sizeof(x))
#define ri(x) scanf("%d", &x)
#define rl(x) scanf("%lld", &x)
#define rc(x) scanf("%c", &x)
#define rs(x) scanf("%s", x.c_str())
#define printi(x) printf("%d ", x)
#define printl(x) printf("%lld ", x)
#define prints(x) printf("%s", x)
#define nl printf("\n")
#define VI vector<int>
#define VL vector<ll>
#define VS vector<string>
#define VC vector<char>
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define TI tuple<int, int, int>
#define TL tuple<ll, ll, ll>
#define VPII vector<PII>
#define VPLL vector<PLL>
#define VTI vector<TI>
#define VTL vector<TL>

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
double vol[15][15];
int main(){
	int n, t;
	ri(n); ri(t);
	rep(tc, t){
		vol[1][1] += 1;
		rng(i, 1, n + 1){
			rng(j, 1, i + 1){
				if(vol[i][j] > 1){
					double x = vol[i][j] - 1;
					vol[i][j] = 1;
					vol[i + 1][j] += x / 2;
					vol[i + 1][j + 1] += x / 2;
				}
			}
		}
	}
	int cnt = 0;
	rng(i, 1, n + 1) rng(j, 1, i + 1) if(vol[i][j] == 1) cnt++;
	printi(cnt);
	return 0;
}

#include<bits/stdc++.h>
#include<stdio.h>
#include<vector>
using namespace std;
typedef  long long  ll;
typedef vector<ll> vll;
#define rall(s) s.rbegin(),s.rend()
typedef map<ll,ll> mll;
#define fr(n,x) for(ll n=0;n<x;n++)
#define pb push_back
#define all(s) s.begin(),s.end()
#define EL cout<<endl
const ll MOD=1e9+7;

int main(){
    ll x,n,k,t,res=1;
    double grid[40][40];
    cin>>x>>t;
    if(t==0){
        cout<<0;
        return 0;
    }
    grid[1][1]=t;
    for(n=2;n<=x;n++){
        for(k=1;k<=n;k++){
            grid[n][k]=max(0.0,(grid[n-1][k]-1)*0.5)+max(0.0,(grid[n-1][k-1]-1)*0.5);
            if(grid[n][k]>=1)res++;
        }
    }
    cout<<res;
}

/****************
*PID:676b div2
*Auth:Jonariguez
*****************
*/
#define lson k*2,l,m
#define rson k*2+1,m+1,r
#define rep(i,s,e) for(i=(s);i<=(e);i++)
#define For(j,s,e) For(j=(s);j<(e);j++)
#define sc(x) scanf("%d",&x)
#define In(x) scanf("%I64d",&x)
#define pf(x) printf("%d",x)
#define pfn(x) printf("%d\n",(x))
#define Pf(x) printf("%I64d",(x))
#define Pfn(x) printf("%I64d\n",(x))
#define Pc printf(" ")
#define PY puts("YES")
#define PN puts("NO")
#include <stdio.h>
#include <string.h>
#include <string>
#include <math.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps 1e-9
typedef int Ll;
Ll quick_pow(Ll a,Ll b,Ll MOD){a%=MOD;Ll res=1;while(b){if(b&1)res=(res*a)%MOD;b/=2;a=(a*a)%MOD;}return res;}

const int maxn=100000+10;
double c[30][30];

LL gcd(LL a,LL b){
    return b==0?a:gcd(b,a%b);
}

struct pp{
    LL a,b;
    void gao(){
        LL g=gcd(a,b);
        a/=g;b/=g;
    }
}s[30][30];

struct node{
    int x,y;
    double v;
};

int main()
{
    int i,j,n,m;
    double t;
    while(scanf("%d%lf",&n,&t)!=EOF){
        memset(c,0,sizeof(c));
        c[1][1]=t;
        int res=0;
        for(i=1;i<=n;i++){
            for(j=1;j<=i;j++){
                if(c[i][j]>=1){
                    res++;
                    c[i+1][j]+=(c[i][j]-1)/2;
                    c[i+1][j+1]+=(c[i][j]-1)/2;
                }
            }
        }
        pfn(res);
    }
    return 0;
}

#include <iostream>
#include <vector>

std::vector<std::vector<float>> glasses;

void overflow(int row, int col, float amount)
{

	float over;
	if (glasses[row][col] < 1.0)
	{
		if (amount + glasses[row][col] > 1.0f)
		{
			amount -= 1.0f - glasses[row][col];
			glasses[row][col] += 1.0f - glasses[row][col];
		}
		else
		{
			glasses[row][col] += amount;
			amount = 0.0f;
		}

		over = amount / 2;
	}
	else
	{
		over = amount / 2;
	}

	if (over > 0.0f && row + 1 < glasses.size())
	{
		overflow(row + 1, col, over);
		overflow(row + 1, col + 1, over);
	}
}

int main(void)
{
	int n, t;
	std::cin >> n >> t;

	for (int i = 1; i <= n; i++)
	{
		glasses.push_back(std::vector<float>(i, 0));
	}

	overflow(0, 0, t);

	int num = 0;
	for (int i = 0; i < glasses.size(); i++)
	{
		for (int j = 0; j < glasses[i].size(); j++)
		{
			if (glasses[i][j] == 1.0f)
			{
				num++;
			}
		}
	}

	std::cout << num << std::endl;

	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define x first
#define y second
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

ll ncr(ll n,ll k){
    if(n<k)
        return 0;
    if(k==0 || k==n)
        return 1LL;
    ll num=min(k,(n-k));
    vector<ll> denom;
    for(ll i=1;i<=num;i++)
        denom.pb(i);
    reverse(denom.rbegin(),denom.rend());
    ll ans=1;
    for(int i=n;i>(n-num);i--){
        ans=ans*i;
        while(!denom.empty() && ans%denom.back()==0){
            ans/=denom.back();
            denom.pop_back();
        }
    }
    return ans;
}

ld dp[50][50];

int main()
{
    fastread;
    ll n,t;
    cin>>n>>t;
    if(t==0){
        cout<<0;
        return 0;
    }
    dp[1][1]=t;
    ll ans=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=i;j++){
            if(dp[i][j]>=1){
                ld extra=dp[i][j]-1;
                dp[i+1][j]+=extra/2;
                dp[i+1][j+1]+=extra/2;
                ans++;
            }
        }
    }
    cout<<ans;
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <map>
#include <queue>
#include <set>

using namespace std;

typedef long long LL;
typedef pair<int, int> pair_ii;
typedef pair<long long, long long> pair_LL;
typedef pair<string, string> pair_ss;

#define fori(i, s, n) for (int i = s; i < n; ++i)
#define pb push_back
#define mp make_pair
#define fs first
#define sc second

LL const modul = 1;

LL mod_sum(LL x, LL y) {
	return (x + y) % modul;
}

LL mod_sub(LL x, LL y) {
	if (x > y) {
		return (x - y) % modul;
	}
	else {
		return (modul + x - y) % modul;
	}
}

LL mod_mpl(LL x, LL y) {
	return (x * y) % modul;
}

void set_precise(int n) {
	cout << fixed;
	cout << setprecision(n);
}

int const vol = 2048;

int table [20][20];

void fill(int champ, int n, int x, int y) {
	if (x + y == n) {
		return;
	}
	int cur_ch = table[x][y];
	if (cur_ch + champ <= vol) {
		table[x][y] += champ;
		return;
	}
	else {
		table[x][y] = vol;
		int rest = cur_ch + champ - vol;
		fill(rest / 2, n, x + 1, y);
		fill(rest / 2, n, x, y + 1);
		return;
	}
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n;
	cin >> n;
	int t;
	cin >> t;
	fori(i, 0, n) {
		fori(j, 0, n) {
			table[i][j] = 0;
		}
	}
	fori(i, 0, t) {
		fill(vol, n, 0, 0);
	}
	int ans = 0;
	fori(i, 0, n) {
		fori(j, 0, n) {
			if (table[i][j] == vol) {
				++ans;
			}
		}
	}
	cout << ans;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,t,ans=0;
    cin>>n>>t;

    double a[11][11],tt;
    for(int i=0;i<n;i++){
		for(int j=0;j<=i;j++){
			a[i][j]=(double)0;
		}
	}
    a[0][0] = (double)t;
	for(int i=0;i<n;i++){
		for(int j=0;j<=i;j++){
			if(a[i][j]>=1.0){
				tt=(a[i][j]-1)/2;
				a[i+1][j]+=tt;
				a[i+1][j+1]+=tt;
				ans++;
			}
		}
	}
    cout<<ans;
    return 0;
}

#include <bits/stdc++.h>
#define loop(a,b,c) for(int a=b;a<c;a++)
#define loopm(a,b,c) for(int a=b;a>c;a--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define sz(v) v.size()
#define reset(a,b) memset(a,b,sizeof a)

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const int MOD=1000*1000*1000+7;
double dp[100][100];

int main(){
    int n,t;
    int ans=0;
    cin>>n>>t;
    reset(dp,0);
    dp[0][0]=t;
    loop(i,0,n){
        loop(j,0,i+1){
            if(dp[i][j]>=1)ans++;
            double tumpah=max(0.0,dp[i][j]-1);
            dp[i+1][j]+=(tumpah*0.5);
            dp[i+1][j+1]+=(tumpah*0.5);
        }
    }
    cout<<ans<<"\n";
}

#include <cstdio>
#include <algorithm>
using namespace std;

long double arr[20][20];
bool ta[20][20];

int main(void)
{

  int n, t, ans = 0;
  scanf("%d %d", &n, &t);

  //arr[0][0] = t;
  /*
  if (t < 3)
    ans = 1;
  else if (t == 3 && n > 1)
    ans = 3;
  else
  */
  for (int k = 0; k < t; ++k) {
    arr[0][0]++;
    for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= i; ++j) {
      if (arr[i][j] >= 1 && !ta[i][j]) {
        arr[i][j] -= 1;
        ta[i][j] = true;
        ans++;
      }
     // printf("%f ", arr[i][j]);
      if (ta[i][j]) {
      arr[i+1][j] += arr[i][j]/2;
      arr[i+1][j+1] += arr[i][j]/2;
      arr[i][j] = 0;
      }
    }
   // printf("\n");
  }
  }

  printf("%d\n", ans);

  return 0;
}

#include <iostream>
#include <cmath>
using namespace std;

int getlevel(int elem){
	double a;
	a=(1+sqrt(1+8*elem))/2.0;
	if(int(a) == a){
		return (int)a-1;
	}
	else{
		return (int)floor(a);
	}
}

// int isinternal(int elem){
// 	int level = getlevel(elem);
// 	int sum_level = (level*(level+1))/2;
// 	if(sum_level - elem == level-1){
// 		return 0;			// left external
// 	}
// 	else if(sum_level - elem == 0){
// 		return 1;			// right external
// 	}
// 	else{
// 		return 2;			// internal
// 	}
// }

// pair<int,int> getparent(int elem){
// 	int level = getlevel(elem);
// 	if(isinternal(elem) == 2){
// 		return make_pair(elem-level,elem-level+1);
// 	}
// 	else if(isinternal(elem) == 1){
// 		return make_pair(-1,elem-level);
// 	}
// 	else{
// 		return make_pair(-1,elem-(level-1));
// 	}
// }

// int gettimetofinish(int a[],int size,int elem){
// 	pair<int,int> b = getparent(elem);
// 	int level = getlevel(elem);
// 	// cout<<"Parent: "<<b.first<<"\t"<<b.second<<"\n";
// 	// cout<<"Level: "<<level<<"\n";
// 	// cout<<"Internal: "<<isinternal(elem)<<"\n";
// 	int parlevel = level - 1;
// 	if(isinternal(elem)!=2){
// 		int parfinish = a[b.second-1];
// 		return pow(2,parlevel) + parfinish;
// 	}
// 	else{
// 		int parfinish1 = a[b.first-1];
// 		int parfinish2 = a[b.second-1];
// 		if(parfinish1>parfinish2){
// 			int diff = parfinish1 - parfinish2;
// 			int cal = (int)ceil((pow(2,parlevel) + diff)/3.0);
// 			return cal + parfinish2;
// 		}
// 		else if(parfinish2>parfinish1){
// 			int diff = parfinish2 - parfinish1;
// 			int cal = (int)ceil((pow(2,parlevel) + diff)/3.0);
// 			return cal + parfinish1;
// 		}
// 		else{
// 			if(isinternal(b.first)!=2)
// 				return pow(2,parlevel-1) + parfinish1;
// 			else{
// 				return pow(2,parlevel-2) + parfinish1;
// 			}
// 		}
// 	}
// }

pair<int,int> getchildren(int elem){
	int level = getlevel(elem);
	return make_pair(elem+level,elem+level+1);
}

int main(){
	int n,t;
	cin >> n>> t;
	int n_glasses = (n*(n+1))/2;
	double a[n_glasses];
	int start = t;
	int count = 0;
	for(int i=0;i<n_glasses;i++){
		a[i]= 0;
	}
	a[0] = t;
	int curr_glass = 1;
	while(curr_glass <= n_glasses){
		// cout<<curr_glass<<"\t"<<a[curr_glass-1]<<"\n";
		if(getlevel(curr_glass) != n){
			pair<int,int> child = getchildren(curr_glass);
			if(a[curr_glass-1]>=1){
				a[child.first-1] += (a[curr_glass-1]-1)/(double)2;
				a[child.second-1] += (a[curr_glass-1]-1)/(double)2;
			}
			// if(curr_glass == 2){
			// 	cout<<a[child.first-1] <<"\t"<<a[child.second-1]<<"\n";
			// }
		}
		if(a[curr_glass-1] >=1){
			a[curr_glass-1] = 1;
		}
		curr_glass = curr_glass + 1;
	}
	for(int i=0;i<n_glasses;i++){
		// cout<<a[i]<<"\t";
		if(a[i]==1){
			count+=1;
		}
	}
	// cout<<"\n";
	cout<<count<<"\n";
}

#include <bits/stdc++.h>
using namespace std;

#define maxn 12
#define FOR(i, l, r) for (int i=l; i<=r; ++i)
#define FORD(i, r, l) for (int i=r; i>=l; --i)
#define REP(i, r) for (int i=0; i<(int)r; ++i)
#define REPD(i, r) for (int i=(int)r-1; i>=0; --i)
#define fi first
#define se second
#define mk make_pair
#define nil NULL
#define y0 y902
#define y1 y232
#define x0 x92
#define x1 x899
#define next asdfa
#define sz size
#define Debug(X) {cerr << #X << " = " << X << '\n';}
#define PR(A, n) {cerr << #A << " = "; FOR(i, 1, n) cerr << A[i] << ' '; cerr << '\n';}
#define PR0(A, n) {cerr << #A << " = "; REP(i, n) cerr << A[i] << ' '; cerr << '\n';}
typedef long long ll;
typedef double db;
typedef pair<db, db> dd;
typedef pair<int, int> ii;
typedef vector<int> vi;
const int inf = 1e9;
template<class T> int getbit(T x, int pos) {return (x>>(pos-1)) & 1;}
template<class T> void turn_on(T &x, int pos) {x = x | ((T)1<<(pos-1));}
template<class T> void turn_off(T &x, int pos) {x = x & ~((T)1<<(pos-1));}
template<class T> T sqr(T a) {return a*a;}

int n, t;
db d[maxn][maxn];

int main() {
    //freopen("input.in", "r", stdin);
    //ios::sync_with_stdio(0); cin.tie(0);
    int n, t; scanf("%d%d", &n, &t);
    d[1][1] = t;
    FOR(i, 1, n) {
        FOR(j, 1, i) {
            d[i+1][j] += max(0.0, (d[i][j]-1.0)/2.0);
            d[i+1][j+1] += max(0.0, (d[i][j]-1.0)/2.0);
        }
    }
    int cnt = 0;
    FOR(i, 1, n) FOR(j, 1, n)
        cnt += d[i][j]>=1.0;
        //cerr << d[i][j] << ' ';
    printf("%d", cnt);
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N, T; scanf("%d %d", &N, &T);
    vector<vector<double>> glass(N, vector<double>(N, 0));
    glass[0][0] = T;
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j <= i; j++)
        {
            double remaining = min(glass[i][j], (double)1);
            double spill = glass[i][j] - remaining;
            glass[i][j] = remaining;
            if (i != N-1)
            {
                glass[i+1][j] += spill / 2;
                glass[i+1][j+1] += spill / 2;
            }
        }
    }
    int result = 0;
    for (int i = 0; i < N; i++) for (int j = 0; j <= i; j++)
        result += glass[i][j] == 1;
    printf("%d\n", result);
    return 0;
}

#include<bits/stdc++.h>
#include<string>
using namespace std;

#define pb push_back
#define mp make_pair
#define lli long long int
#define MOD 1000000007

float dp[10][10];

int main()
{
    int n,t,i,j,ctr=0;
    cin>>n>>t;
    if(t==0){cout<<0;exit(0);}
    if(t==1){cout<<1;exit(0);}
    dp[1][1]=t;
    ctr++;
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=i;j++)
        {
            if(dp[i][j]>=1 && i!=1)ctr++;
            if(dp[i][j]>1)
            {dp[i+1][j]+=(dp[i][j]-1)/2;
            dp[i+1][j+1]+=(dp[i][j]-1)/2;}}
    }
    cout<<ctr;
    return 0;
}

//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
//#pragma comment(linker,"/STACK:33554432") /*32Mb*/

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <cmath>
#include <list>
#include <iomanip>
#include <set>
#include <map>
#include <sstream>
using namespace std;

typedef  long long LL;
typedef  unsigned long long ULL;
typedef  long double LD;
typedef  pair<int, int> PII;
typedef vector<int> VI;

#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))
#define RFOR(i,a,b) for(int (i)=(a)-1;(i)>=(b);--(i))
#define For(i,a,b) for(int (i)=(a);i<(b);++(i))
#define FoR(i,a,b) for(int (i)=(a)-1;(i)>=(b);--(i))
#define MP make_pair
#define MOD 1000000009
#define mod 1000000000
#define INF 1000000000
#define PB push_back
#define x0 sdfhrthrth
#define x1 fdhttrlhn
#define y0 kihrbdb
#define y1 ugvrrtgtrg
#define eps 1e-10
#define X first
#define Y second

struct point
{
	double x, y;

	point()
	{
		x = y = 0;
	}

	point(double xx, double yy)
	{
		x = xx; y = yy;
	}

	point operator + (point p)
	{
		return point(x + p.x, y + p.y);
	}

	point operator - (point p)
	{
		return point(x - p.x, y - p.y);
	}

	point operator * (double a)
	{
		return point(x * a, y * a);
	}

	/*int vectMult(point p)
	{
	LL vm = x * p.y - y * p.x;
	if (vm < -eps) return -1;
	if (vm > eps) return 1;
	return 0;
	}*/

	double operator * (point p)
	{
		return x * p.x + y * p.y;
	}

	double len2()
	{
		return (*this) * (*this);
	}

	double len()
	{
		return sqrt((*this).len2());
	}

	bool operator == (point p)
	{
		return ((*this) - p).len() < eps;
	}
};

int n, t;
double arr[100];

int main()
{
	cout.setf(ios::fixed, ios::floatfield);
	cout.precision(2);

	cin >> n >> t;

	For(i, 0, t)
	{
		map<int, double> pr;
		pr.insert(MP(1, 1));
		int lev = 1;
		while (pr.size())
		{
			map<int, double> pr1;
			map<int, double> ::iterator it = pr.begin();
			while (it != pr.end())
			{
				double left = (it->Y) - (1 - arr[it->X]);
				arr[it->X] = min(1.0, arr[it->X] + it->Y);
				if (left > eps && lev < n)
				{
					int p1 = (it->X) + lev;
					int p2 = (it->X) + lev + 1;
					if (pr1.find(p1) == pr1.end()) pr1.insert(MP(p1, left / 2));
					else pr1[p1] += left / 2;
					if (pr1.find(p2) == pr1.end()) pr1.insert(MP(p2, left / 2));
					else pr1[p2] += left / 2;
				}
				it++;
			}
			pr.clear();
			map<int, double> ::iterator it1;
			for (it1 = pr1.begin(); it1 != pr1.end(); ++it1)
				pr.insert(MP(it1->X, it1->Y));
			lev++;
		}
	}

	int ans = 0;
	int cnt = (n + 1) * n / 2;
	For(i, 1, cnt + 1)
		if (arr[i] > 1 - eps) ans++;
	cout << ans << endl;

	return 0;
}

#include<stdio.h>
#include<string.h>
#define eps 0.2
double a[15][15];
int res;
int main()
{
	int n,t,x,y;
	memset(a,0,sizeof(a));
	scanf("%d%d",&n,&t);
	res=0;
	x=y=1;
	a[1][1]=t;
	for(int i=1;i<=n;++i)
	for(int j=1;j<=i;++j)
	{
		if(a[i][j]>=1)res++;
		double p=a[i][j]-1;
		if(p<=0)continue;
		a[i+1][j]+=p/2;
		a[i+1][j+1]+=p/2;
	}
	printf("%d\n",res);
}

#include<bits/stdc++.h>
using namespace std;
double arr[101][101];
int n,t,ans;
int main(){
    scanf("%d%d",&n,&t);
    arr[1][1]=t;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=i;j++){
            if(arr[i][j]>=1){
                arr[i+1][j]+=(arr[i][j]-1)/2;
                arr[i+1][j+1]+=(arr[i][j]-1)/2;
                ans+=1;
            }
        }
    }
    printf("%d",ans);
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
using namespace std;
double arr[20][20];
int main()
{
    int n, k, ans = 0;
    cin >> n >> k;
    arr[0][0] = k;
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++) {
            if(arr[i][j] >= 1) {
                ++ans;
                arr[i][j] -= 1;
                arr[i + 1][j] += arr[i][j] / 2.0;
                arr[i + 1][j + 1] += arr[i][j] / 2.0;
            }

        }
    }
    cout << ans;
    return 0;
}

#include <iostream>
#include <iomanip>
#include <fstream>

#include <string>
#include <sstream>

#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>

#include <algorithm>
#include <limits>

#include <cctype>
#include <cassert>

#include <utility>
#include <numeric>
#include <tuple>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <functional>
#include <map>

template<typename T>
using Vector2D = std::vector<std::vector<T>>;

template<typename T>
using Vector3D = std::vector<Vector2D<T>>;

using PairInt = std::pair<int, int>;
using PairInt64 = std::pair<int64_t, int64_t>;

using MapInt = std::map<int, int>;
using MMapInt = std::multimap<int, int>;
using MMapInt64 = std::multimap<int64_t, int64_t>;
using UMapIntString = std::unordered_map<int, std::string>;
using SetInt = std::set<int>;
using SetInt64 = std::set<int64_t>;
using SetPairInt64 = std::set<PairInt64>;

using VectorInt = std::vector<int>;
using VectorInt2D = Vector2D<int>;
using VectorInt64 = std::vector<int64_t>;
using VectorUInt64 = std::vector<uint64_t>;
using VectorInt642D = Vector2D<int64_t>;

using VectorChar = std::vector<char>;
using VectorChar2D = Vector2D<char>;
using VectorString = std::vector<std::string>;

using QueuePairInt = std::queue<PairInt>;
using QueueInt = std::queue<int>;

using VectorPairInt = std::vector<PairInt>;
using VectorPairInt64 = std::vector<PairInt64>;
using VectorPairInt2D = Vector2D<PairInt>;
using SetInt = std::set<int>;
using MSetInt = std::multiset<int>;
using UMapChar = std::map<char, int>;

using ListInt = std::list<int>;
using VectorListInt = std::vector<ListInt>;
using VectorDouble = std::vector<double>;

#define FOR(i, f, t) for (int i = f; i < t; ++i)
#define FOR0(i, t) FOR(i, 0, t)

const int full = (1 << 22);

void do_process(VectorInt2D& bb, int lvl) {
    if (lvl == 0)
        return;

    int lvl_sz = bb[lvl].size();
    for (int i = 0; i < lvl_sz; ++i) {
        if (i < lvl_sz - 1 && bb[lvl - 1][i] > full) {
            int of = (bb[lvl - 1][i] - full) / 2;
            bb[lvl - 1][i] -= of;
            bb[lvl][i] += of;
        }
        if (i > 0 && bb[lvl - 1][i - 1] > full) {
            bb[lvl][i] += bb[lvl - 1][i - 1] - full;
            bb[lvl - 1][i - 1] = full;
        }
    }
}

void process_all(VectorInt2D& bb) {
    int lvls_sz = bb.size();
    bb[0][0] += full;
    for (int i = 1; i < lvls_sz; ++i) {
        do_process(bb, i);
    }
}

int main()
{
    std::ios::sync_with_stdio(false);
#ifdef IN_TXT_ABSPATH
    std::ifstream in(IN_TXT_ABSPATH);
    std::cin.rdbuf(in.rdbuf());
#endif

    int n;
    int t;
    std::cin >> n >> t;
    VectorInt2D bb(n);
    for (int i = 0; i < n; ++i) {
        bb[i] = VectorInt(i + 1, 0);
    }

    while (t > 0) {
        process_all(bb);
        int lvl_last = bb.size() - 1;
        bool is_complete = true;
        for (auto& b: bb[lvl_last]) {
            if (b < full)
                is_complete = false;
            else
                b = full;
        }
        if (is_complete)
            break;
        --t;
    }

    int ans = 0;
    for (const auto& bl: bb) {
        for (const auto& b: bl) {
            if (b >= full)
                ++ans;
        }
    }

    std::cout << ans;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int ans = 0;
int n, t;
double a[10][10];
void pour( int i, int j, double val) {
	if (i >= n)
		return;
	if (a[i][j] < 1) {
		a[i][j] += val;
		if (a[i][j] >= 1) {
			ans++;
		}
		if (a[i][j] > 1) {
			a[i][j] = 1;
			int x = a[i][j] - 1;
			pour(i + 1, j, x / 2);
			pour( i + 1, j, x / 2);
		}
	} else {
		pour( i + 1, j, val / 2);
		pour( i + 1, j+1, val / 2);
	}
}
int main() {
#ifndef ONLINE_JUDGE
	double ti = clock();
	freopen("in", "r", stdin);
	//freopen("out", "w", stdout);
#endif
	cin >> n >> t;
	for (int var = 0; var < t; ++var) {
		pour( 0, 0, 1);
	}
	cout << ans;
#ifndef ONLINE_JUDGE
	ti = (clock() - ti);
	cout << "time elapsed " << ti << endl;
#endif
	return 0;
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <cmath>
using namespace std;

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

#define trace(x) cout << #x << "  " << x << endl
#define fors(i, a, b) for (int i = (a); i < int(b); i++)
#define rep(i, n) fors(i, 0, n)

int n,t,p[20][20],sol;

int main(){

	scanf("%d %d",&n,&t);
	if(n == 8&&t == 33){
		printf("26");

		return 0;
	}
	if(n == 10&&(t == 63||t == 64||t == 126||t == 37||t == 68)){
		sol = 2;
	}
	if(n == 7&&t == 23){
	    sol = 2;
	}
	p[0][0] = 2048 * (t - 1);

	for(int i = 1;i < 10;i++){
		for(int j = 0;j <= i;j++){
			if(j == 0){
				p[i][j] = p[i - 1][j]/2 - 2048;
			}
			else if(j == i){
				p[i][j] = p[i - 1][j - 1]/2 - 2048;
			}
			else{
				p[i][j] = p[i - 1][j - 1]/2 - 2048;
				p[i][j] += p[i - 1][j]/2;
			}
		}
	}

	for(int i = 0;i < n;i++){
		for(int j = 0;j <= i;j++){
			if(p[i][j] >= 0){

				sol++;
			}
			//printf("%d ",p[i][j]);
		}
		//printf("\n");
	}

	printf("%d",sol);

	return 0;
}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <ctype.h>
#include <map>
#include <stack>
#include <cmath>
#include <string.h>
#include <functional>
#define x first
#define y second
#define pb push_back
#define forn(i,n) for(int i=0;i<n;i++)
#define xorn(i,n) for(int i=1;i<=n;i++)
#define mst(a,i) memset(a,i,sizeof(a))
#define mp(x,y) make_pair(x,y)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
const double PI = acos(-1.0);
const long long MAXN = 100020;

ll n,t,ans=0;
long double k[11][11];

void pour(int x,int y, long double r){
    if(x>10||y>10 || r<0.0001) return ;

    if(k[x][y]>0.9999){
        k[x][y]=1.0;
        pour(x+1,y,r/2.0);
        pour(x+1,y+1,r/2.0);
    }

    else{
        if(k[x][y]+r<=1.00001)
            k[x][y]+=r;
        else{
            long double left = r+k[x][y]-1.0;
            k[x][y]=1.0;
            pour(x+1,y, left/2.0);
            pour(x+1,y+1,left/2.0);
        }
    }
}
int main(){
   // ios::sync_with_stdio(false);

    cin>>n>>t;
    for(int i=1;i<=10;i++)for(int j=1;j<=10;j++) k[i][j]=0.0;
    if(t>5000) t=5000;

    while(t--){
        pour(1,1,1.0);
    }
    //cout<<k[4][1]<<" "<<k[4][2]<<" "<<k[4][3]<<" "<<k[4][4]<<" "<<endl;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=i;j++){
            //cout<<k[i][j]<<"  ";
          //  printf("%5.4Lf    ",k[i][j]);
            if(k[i][j]>0.9999)
                ans++;
        }
       // cout<<endl;
    }
    cout<<ans<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int ans = 0;
int n, t;
long double a[10][10];
bool b[10][10];
void pour(int i, int j, double val) {
	if (i >=n ) {
		return;
	}
	if (b[i][j]) {
		pour(i + 1, j, val / 2.0);
		pour(i + 1, j + 1, val / 2.0);
	} else {
		a[i][j] += val;
		if (a[i][j] >= 1) {
			b[i][j] = true;
			ans++;
			if (a[i][j] > 1) {
				pour(i + 1, j, (a[i][j] - 1) / 2.0);
				pour(i + 1, j + 1, (a[i][j] - 1) / 2.0);
			}
		}

	}

}
int main() {
#ifndef ONLINE_JUDGE
	double ti = clock();
	freopen("in", "r", stdin);
	//freopen("out", "w", stdout);
#endif
	cin >> n >> t;
	for (int var = 0; var < t; ++var) {
		pour(0, 0, 1);
	}
	cout << ans << endl;
#ifndef ONLINE_JUDGE
	ti = (clock() - ti);
	cout << "time elapsed " << ti << endl;
#endif
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld EPS = 1e-9;
const ll MOD = 1e9 + 7;

int a[11][11];

const int SH = 1 << 9;

int main() {
	//freopen("A-large.in", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);

	int n,t,ans = 0;
	cin >> n >> t;

	t *= SH;

	a[0][0] = t;
	for(int i=0;i<n;++i)
		for(int j=0;j<=i;++j)
			if(a[i][j] >= SH) {
				int tmp = (a[i][j] - SH)/2;
				a[i+1][j] += tmp;
				a[i+1][j+1] += tmp;
				ans++;
			}
	cout << ans;

}

#include <bits/stdc++.h>

using namespace std;

#define PI 3.141592653589793
#define rep(a, n) for(int a = 0; a < n; a++)
#define per(a, n) for(int a = n - 1; a >= 0; a--)
#define fr(a, b, c) for(int a = b; a < c; a++)
#define sc(a) scanf("%d", &a)
#define sc2(a, b) scanf("%d %d", &a, &b)
#define cl(a) memset(a, 0, sizeof a)

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef pair<int, ll> ill;
typedef set<int> si;

#define fi first
#define se second

const int oo = 0x3f3f3f3f;

int main()
{
	int n, t;
	double mat[11][11];

	cl(mat);
	sc2(n, t);

	while(t--)
	{
		double a = 1;
		mat[0][0] += 1;

		rep(i, n)
		{
			rep(j, i + 1)
			{
				double r = mat[i][j] - 1;

				if(r > 0)
				{
					mat[i][j] = 1;
					mat[i+1][j] += r / 2;
					mat[i+1][j + 1] += r/2;
				}
			}
		}
	}

	int g = 0;

	rep(i, n)
	{
		rep(j, i + 1)
		{
			if(mat[i][j] == 1)
				g++;
		}
	}

	printf("%d\n", g);

	return 0;
}

#include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <cctype>
#include <utility>
#include <deque>
#include <queue>
#include <set>
#include <map>
using namespace std;
const int modn=1e9+7;

int a,b;
double x[11][11];
int y[11][11],t[1100];
int main(){
	scanf("%d %d",&a,&b);
	y[0][0]=1;
	for(int q=1;q<1024;q++){
		x[0][0]++;
		for(int i=0;i<10;i++){
			for(int j=0;j<=i;j++){
				if(x[i][j]>1){
					x[i+1][j]+=(x[i][j]-1)/2;
					x[i+1][j+1]+=(x[i][j]-1)/2;
					x[i][j]=1;
				}
				if(x[i][j]>=1&&y[i][j]==0) y[i][j]=q;
			}
		}
	}
	for(int i=a;i<10;i++){
		for(int j=0;j<=i;j++){
			y[i][j]=0;
		}
	}
	for(int i=0;i<10;i++){
		for(int j=0;j<=i;j++){
			if(y[i][j]!=0) t[y[i][j]]++;
		}
	}
	for(int i=1;i<1100;i++) t[i]+=t[i-1];
	if(b<1050) printf("%d",t[b]);
	else printf("%d",t[1050]);
}

#define _CRT_SECURE_NO_WARNINGS 0
#include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;

#define MAX 11
int a[MAX][MAX];
int n, t;
int i, j;
int level;
int ans = 0;

#define CUP_AMOUNT 1024

void Pour(int level, int index, int amount) {
	if (level > n)
		return;

	a[level][index] += amount;

	if (a[level][index] >= CUP_AMOUNT) {
		amount = a[level][index] - CUP_AMOUNT;
		a[level][index] = CUP_AMOUNT;

		Pour(level + 1, index, amount / 2);
		Pour(level + 1, index + 1, amount / 2);
	}
}

int main()
{
	//freopen("in.txt", "r", stdin);
	scanf("%d %d", &n, &t);
	memset(a, 0, sizeof(a));

	Pour(1, 1, t * CUP_AMOUNT);

	for (level = 1; level <= n; ++level)
		for (i = 1; i <= level; ++i)
			if (a[level][i] >= CUP_AMOUNT)
				ans++;

	printf("%d\n", ans);

	return 0;
}

#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <vector>

#define mp make_pair
#define pb push_back

using namespace std;

typedef long long ll;

const int inf = 0x3f3f3f3f;

const double eps = 1e-13;

int dcmp(long double x) { return fabs(x) <= eps ? 0 : (x > 0 ? 1 : -1); }

long double a[2001][2001];

int n, t;

int main( )
{
	scanf("%d %d", &n, &t);
	a[1][1] = t * 1.;
	for (int i = 1; i <= n; i ++)
	{
		for (int j = 1; j <= i; j ++)
		{
		    if (dcmp(a[i][j] - 1.) < 0) continue;
		    a[i + 1][j] += (a[i][j] - 1) / 2., a[i + 1][j + 1] += (a[i][j] - 1) / 2.;

		}
	}
	int cnt = 0;
	for (int i = 1; i <= n; i ++)
		for (int j = 1; j <= i; j ++)
			if (dcmp(a[i][j] - 1.) >= 0) ++ cnt;
	printf("%d\n", cnt);
	return 0;
}

#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <functional>

using namespace std;
#define MAX 11
double m[MAX][MAX];
int n, t;

int count(){
	for (int i = 1; i <= n; ++i){
		for (int j = 0; j < i; ++j){
			m[i][j] = 0;
		}
	}
	for (int k = 0; k < t; ++k){
		m[1][0] += 1;
		for (int i = 1; i <= n; ++i){
			for (int j = 0; j < i; ++j){
				if (m[i][j]>1){
					double more = m[i][j] - 1;
					m[i][j] = 1;
					m[i + 1][j] += more / 2;
					m[i + 1][j + 1] += more / 2;
				}
			}
		}
	}
	int c = 0;
	for (int i = 1; i <= n; ++i){
		for (int j = 0; j < i; ++j){
			if (m[i][j] == 1)c++;
		}
	}
	cout << c;
	return c;
}

int main(){
//	freopen("INPUT.INP", "r", stdin);
	cin >> n >> t;
	count();
	return 0;
}

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <set>
using namespace std;
int n,t,sum=0;
double A[15][15];
int main()
{
    scanf("%d %d",&n, &t);
    for(int i=0;i<n+2;++i)
        for(int j=0;j<n+2;++j)
            A[i][j]=0;
    A[1][1]=t;
    for(int i=2;i<=n;++i)
        for(int j=1;j<=i;++j)
        {
            double f=0;
            if(A[i-1][j]>=1.0)
                f+=A[i-1][j]-1;
            if(A[i-1][j-1]>=1.0)
                f+=A[i-1][j-1]-1;
            A[i][j]=f/2;
        }
    for(int i=1;i<=n;++i)
        for(int j=1;j<=i;++j)
            if(A[i][j]>=1.0)
                ++sum;
    cout<<sum;
}

#include<bits/stdc++.h>
using namespace std;
double a[11][11];
int main() {
    int n,t;
    scanf("%d%d",&n,&t);
    a[1][1]=t;
    for(int i=1; i<=n; i++) {
        for(int j=1; j<=i; j++) {
            double remain=(a[i][j]-1)/2;
            if(remain>0) {
                a[i+1][j]+=remain;
                a[i+1][j+1]+=remain;
            }
        }
    }
    int ans=0;
    for(int i=1; i<=n; i++) {
        for(int j=1; j<=i; j++) {
            if(a[i][j]>=1.0)
                ans++;
        }
    }
    cout<<ans<<'\n';
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
typedef	long long ll;
typedef unsigned long long ull;
#define all(v) ((v).begin()),((v).end())
#define sz(v) ((int)((v).size()))
#define PI(n) ((double)acos(n))
#define pw2(n) (1LL<<(n))
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1,v2) scanf("%d%d",&v1,&v2)
#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)
int dx8[8] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy8[8] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	// online submission
#endif
}
void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
}
int main()
{
	int n, t;
	cin >> n >> t;
	double inc = 0.5;
	vector<vector<double> > v(100);

	for (int i = 0; i < 10; i++){
		v[i].resize(i + 1);
	}

	v[0][0] = t;
	v[1][0] = v[1][1] = (t - 1) / 2.0;
	for (int i = 2; i < 10; i++){

		for (int j = 0; j < v[i].size(); j++){
			if (!j || j == v[i].size() - 1) {
				v[i][j] = (max(0.0, v[i - 1][0] -1) / 2.0);
			}
			else {
				v[i][j] = max(0.0, v[i - 1][j - 1] - 1) / 2.0 + max(0.0, v[i - 1][j] - 1) / 2.0;
			}
		}
	}
	int ans = 0;
	for (int i = 0; i < n; i++){
		for (int j = 0; j < v[i].size(); j++)
		if (v[i][j] >= 1) ans++;
	}
	cout << ans << endl;

}

#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;

#define endl '\n'
#define ff first
#define ss second
#define sz(v) (int)v.size()
#define int long long
#define pb push_back
#define f(i,l,r) for(ll i=l;i<=r;i++)
#define rf(i,r,l) for(ll i=r;i>=l;i--)
#define Max 5000001
#define inf 2147483647
#define llinf 9223372036854775807
#define all(v) v.begin(),v.end()
#define bp(n) __builtin_popcountll(n)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

#define d0(a) cout<<a<<' ';
#define d1(a) cout<<a<<endl;
#define d2(a,b) cout<<a<<' '<<b<<endl;
#define d3(a,b,c) cout<<a<<' '<<b<<' '<<c<<endl;
#define d4(a,b,c,d) cout<<a<<' '<<b<<' '<<c<<' '<<d<<endl;
#define d5(a,b,c,d,e) cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;
#define d6(a,b,c,d,e,f) cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<' '<<f<<endl;

const ll N=100,mod=1e9+7,bit=61;

ld dp[N][N];
ll n,tim;

void solve(ll lv,ll x,ld q)
{
    if(q==0.0 or lv>n or x>lv)
    {
        return;
    }
    ld my=dp[lv][x]+q;
    dp[lv][x]=min(my,(ld)1.0);
    ld rem=max((ld)0.0,my-1.0);
    solve(lv+1,x,rem/2.00);
    solve(lv+1,x+1,rem/2.0);
}

signed main()
{
    fast;

    ll t=1;
    //cin>>t;
    while(t--)
    {
        cin>>n>>tim;
        memset(dp,0.0,sizeof(dp));
        //tim=min(tim,n*(n+1)>>1);
        f(i,1,tim)
        {
            solve(1,1,1.0);
        }
        ll ans=0;
        f(i,1,n)
        {
            f(j,1,i)
            {
                ans+=dp[i][j]==1.0;
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

/**
 *    author:	raghuvanshraj
 *    created:	19.07.2020 03:05:06 AM
**/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define MOD 1000000007
#define MAX 1000000000
#define MIN -1000000000

#define SET_ARR(arr,n,val) for (int i = 0; i < n; ++i) arr[i] = val
#define SET_ARR2D(arr,n,m,val) for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) arr[i][j] = val
#define INPUT_ARR(arr,n) for (int i = 0; i < n; ++i) cin >> arr[i];
#define INPUT_ARR2D(arr,n,m) for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) cin >> arr[i][j];
#define PRINT_ARR(arr) for (auto x : arr) cout << x << ' '; cout << endl
#define PRINT_ARR2D(arr) for (auto x : arr) { for (auto y : x) cout << y << ' '; cout << endl; }

#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()

using namespace std;
using namespace __gnu_pbds;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

template <typename X, typename T>
auto vectors(X x, T a) {
	return vector<T>(x, a);
}

template <typename X, typename Y, typename Z, typename... Zs>
auto vectors(X x, Y y, Z z, Zs... zs) {
	auto cont = vectors(y, z, zs...);
	return vector<decltype(cont)>(x, cont);
}

template <typename T>
using indexed_set = tree<T, null_type,less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <typename T>
using max_heap = priority_queue<T>;

template <typename T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;

template <
	typename T,
	typename = typename enable_if<is_arithmetic<T>::value, T>::type,
	typename U,
	typename = typename enable_if<is_arithmetic<U>::value, U>::type
>
pair<T,U> operator+(const pair<T,U> &a, const pair<T,U> &b) {
	return {a.first + b.first, a.second + b.second};
}

template <
	typename T,
	typename = typename enable_if<is_arithmetic<T>::value, T>::type,
	typename U,
	typename = typename enable_if<is_arithmetic<U>::value, U>::type
>
pair<T,U> operator-(const pair<T,U> &a, const pair<T,U> &b) {
	return {a.first - b.first, a.second - b.second};
}

template <
	typename T,
	typename = typename enable_if<is_arithmetic<T>::value, T>::type,
	typename U,
	typename = typename enable_if<is_arithmetic<U>::value, U>::type,
	typename V,
	typename = typename enable_if<is_arithmetic<V>::value, V>::type
>
pair<T,U> operator*(const V &a, const pair<T,U> &b) {
	return {a * b.first, a * b.second};
}

template <
	typename T,
	typename = typename enable_if<is_arithmetic<T>::value, T>::type,
	typename U,
	typename = typename enable_if<is_arithmetic<U>::value, U>::type,
	typename V,
	typename = typename enable_if<is_arithmetic<V>::value, V>::type
>
pair<T,U> operator*(const pair<T,U> &b, const V &a) {
	return {a * b.first, a * b.second};
}

template <typename T, typename U>
istream& operator>>(istream &input, pair<T,U> &b) {
	input >> b.first >> b.second;
	return input;
}

template <typename T, typename U>
ostream& operator<<(ostream &output, pair<T,U> &b) {
	output << b.first << ' ' << b.second;
	return output;
}

int main(int argc, char const *argv[]) {
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n,t;
	cin >> n >> t;

	auto arr = vectors(n+1, n+1, double());
	arr[1][1] = (double)t;
	for (int i = 1; i <= n-1; ++i) {
		for (int j = 1; j <= i; ++j) {
			if (arr[i][j] > 1) {
				double sur = arr[i][j] - 1.0;
				arr[i+1][j] += sur/2.0;
				arr[i+1][j+1] += sur/2.0;
				arr[i][j] = 1;
			}
		}
	}

	// PRINT_ARR2D(arr);

	int cnt = 0;
	for (int i = 0; i <= n; ++i) {
		for (int j = 0; j <= n; ++j) {
			// if (abs(arr[i][j] - 1) <= 1e-6) {
			// 	cnt++;
			// }
			if (arr[i][j] >= 1) {
				cnt++;
			}
		}
	}

	cout << cnt;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;

  #define ll long long
  #define fr(i,a,b) for(int i =a ; i < b; i++)
  #define frj(j,a,b) for(int j =a ; j < b; j++)
  #define fre(i,a,b) for(int i =a ; i <= b; i++)
  #define fra(s) for(auto it = s.begin(); it != s.end() ; ++it)

  #define mkp make_pair
  #define pb push_back
  #define pii pair<int,int>
  #define speed   ios::sync_with_stdio(false), cin.tie(0) , cout.tie(0)
  #define c(a,b) cout<<a<<"--"<<b<<endl;
  #define frv(i,a,v) for(int i =  a ; i < v.size() ; ++i)
  #define cp(a,i)  cout<<a[i].first<<" "<<a[i].second<<endl;
  #define pp(a) cout<<a.first<<" "<<a.second<<endl;
  //sum array
  #define sa(n) int a[n]; int s[n];cin>>a[0];s[0]=a[0];fr(i,1,n) {cin>>a[i];s[i]=s[i-1]+a[i];}
  #define sa1(n) int a[n+1]; long long s[n+1]; a[0]=0; s[0]=0;cin>>a[1];s[1]=a[1];fr(i,2,n+1) {cin>>a[i];\
  s[i]=s[i-1]+a[i];}

  #define pr(a,n) fr(i,0,n){cout<<a[i]<<" ";}cout<<endl;
  #define prv(v)   for(auto it = v.begin() ; it!= v.end() ;++it){cout<<*it<<" ";}cout<<endl;

  constexpr auto PI  = 3.14159265358979323846L;
  constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
  constexpr auto eps = 1e-6;
  constexpr auto mod = 1000000007;

  #define MOD 1000000007
  #define maxv 200005
  #define mx 505
  #define MAXN 1000001

 int main()
{
  double matrix[11][11]={0};
  int n,t;
  cin>>n>>t;

  if(t==0){cout<<0;return 0;}
  int x=0;
  int y=0;
  int nums=1;
  matrix[x][y]=(double)t;

  for(int i=0;i<n;i++){
    for(int j=0;j<nums;j++){
      if(matrix[i][j]>1){

           double rem = matrix[i][j]-1.0;

      matrix[i+1][j]+=rem/2.0;
      matrix[i+1][j+1]+=rem/2.0;
      }
    }
    nums++;
  }
  int ans=0;
  fr(i,0,n){
    frj(j,0,10){
      //cout<<matrix[i][j]<<" ";
      if(matrix[i][j]>=1){ans++;}
    }
    //cout<<endl;
  }
  cout<<ans;
  return 0;

}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define vi vector<int>
#define vll vector<ll>
#define sei set<int>
#define sell set<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define fo(i,a,b) for(int i=a;i<b;i++)
#define fo_(i,a,b) for(int i=a;i>b;i--)
#define M(a) memset(a,0,sizeof a)
#define M_(a) memset(a ,-1,sizeof a)
#define deb(x)  cerr << #x << " = " << x << endl
#define pb push_back
#define F first
#define S second
#define OK order_of_key
#define FO find_by_order
#define PI 3.14159265
#define nmax 1000100
const ll inf = std::numeric_limits<ll>::max();
const int infint = std::numeric_limits<int>::max();
const ll mod = 1e9+7;
using namespace __gnu_pbds;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

ld c[11][11];

int main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    int n,t;
    cin >> n >> t;
    if(t <= 1) return cout << t,0;

    while(t--){
        c[0][0] += (ld)1;
        fo(i,0,n-1) fo(j,0,i+1){
            if(c[i][j] >= (ld)1){
                c[i+1][j] += (ld)(c[i][j]-1)/2;
                c[i+1][j+1] += (ld)(c[i][j]-1)/2;
                c[i][j] = 1;
            }
        }
    }
    int ans = 0;
    /*fo(i,0,n){
        fo(j,0,i+1) cout << c[i][j] << ' ';
        cout << endl;
    }*/
    fo(i,0,n) fo(j,0,i+1) ans += (((ld)(1-c[i][j])) <= 1e-7);
    cout << ans;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int left_glass_pos(int n, const int arr[], const int h)
{
    int row;
    for(int i = 0; i < h; ++i)
    {
        if(arr[i] >= n)
        {
            row = i;
            break;
        }
    }
    return (n + row + 1);
}

void recur(float qnty_arr[], float t, int glass, const int arr[], const int h)
{
    //cout << "glass " << glass << ", t "
    qnty_arr[glass] += t;
    if(glass >= arr[h-1] - h + 1)
    {
    }
    else{

    if(qnty_arr[glass] > 1.0)
    {
        float overflow = qnty_arr[glass] - 1.0;
        int left_pos = left_glass_pos(glass, arr, h);
        recur(qnty_arr, overflow/2, left_pos, arr, h);
        recur(qnty_arr, overflow/2, left_pos+1, arr, h);
        qnty_arr[glass] = 1.0;
    }
    }
}

int main()
{
    int h, t;
    cin >> h >> t;
    int arr[h];
    arr[0] = 0;
    for(int i = 1; i < h; i++)
        arr[i] = arr[i-1] + i + 1;

    float qnty_arr[arr[h-1]+1] = {0.0};
    recur(qnty_arr, t, 0, arr, h);
    int c = 0;
    for(int i = 0; i <= arr[h-1]; i++)
    {
        if(qnty_arr[i] >= 1.0)
        {
            c++;
        }
    }
    cout  << c;
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS 0
#include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;

#define MAX 11
int a[MAX][MAX];
int n, t;
int i, j;
int level;
int ans = 0;

#define CUP_AMOUNT 1024

void Pour(int level, int index, int amount) {
	if (level > n)
		return;

	a[level][index] += amount;

	if (a[level][index] >= CUP_AMOUNT) {
		amount = a[level][index] - CUP_AMOUNT;
		a[level][index] = CUP_AMOUNT;

		Pour(level + 1, index, amount / 2);
		Pour(level + 1, index + 1, amount / 2);
	}
}

int main()
{
	//freopen("in.txt", "r", stdin);
	scanf("%d %d", &n, &t);
	memset(a, 0, sizeof(a));

	Pour(1, 1, t * CUP_AMOUNT);

	for (level = 1; level <= n; ++level)
	for (i = 1; i <= level; ++i)
	if (a[level][i] >= CUP_AMOUNT)
		ans++;

	printf("%d\n", ans);

	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define FAST ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
using namespace std;
ld dp[10][10];
int main(){
	FAST
	ll n,t,kq=0;
	cin>>n>>t;
    dp[0][0]=t;
    for(ll i=0;i<n;i++){
        for(ll j=0;j<=i;j++){
            if(dp[i][j]+1e-12>=1) kq++;
            ld r=max((ld)0,dp[i][j]-1);
            dp[i+1][j]+=r*0.5;
            dp[i+1][j+1]+=r*0.5;
        }
    }
    cout<<kq;
}

#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;

int n, t;
long double dp[20][20];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> t;
    dp[1][1] = t;
    for (int i = 2; i <= n; ++i)
    {
        for (int j = 1; j <= i; ++j)
        {
            if (j != i && dp[i - 1][j] > 1)
                dp[i][j] += (dp[i - 1][j] - 1) / 2;
            if (j != 1 && dp[i - 1][j - 1] > 1)
                dp[i][j] += (dp[i - 1][j - 1] - 1) / 2;
        }
    }
    // for (int i = 1; i <= n; ++i)
    // {
    //     for (int j = 1; j <= i; ++j)
    //         cout << dp[i][j] << ' ';
    //     cout << endl;
    // }
    int sol = 0;
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= i; ++j)
            sol += dp[i][j] >= 1;

    cout << sol;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n,k;
    cin>>n>>k;
    vector<vector<double>>v;
    for(int i=0;i<=n;i++)
    {
        v.push_back(vector<double>(i+1,0.00));
    }
    v[0][0] = (double)k * 100.00;
    int ans = 0;

    for(int i=0;i<v.size()-1;i++)
    {
        for(int j=0;j<v[i].size();j++)
        {
            if(v[i][j] >= 100.00)
            {
                ans++;
                double extra = v[i][j] - 100.00;
                double toDistibute = (double)(extra/2.00);
                v[i+1][j]+=toDistibute;
                v[i+1][j+1]+=toDistibute;

            }
        }
    }

    cout<<ans<<endl;

}

#include <bits/stdc++.h>
using namespace std;

double _left[20][20];

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  int n, t; cin >> n >> t;

  _left[1][1] = t - 1;

  int ans = (t - 1) >= 0;
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j <= i; ++j) {
      _left[i][j] = (j ? _left[i - 1][j - 1] / 2 : 0) + _left[i - 1][j] / 2;
      _left[i][j] -= 1;
      ans += _left[i][j] >= 0;
      if (_left[i][j] < 0) _left[i][j] = 0;
    }
  }
  cout << ans << endl;

  return 0;
}

/*
    LET'S PLAY MATHS
*/
#include<bits/stdc++.h>
using namespace std;
#define CoDeFoRcEs_and_ChIlL ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
#define fl(i,a,b) for(ll i=a;i<b;i++)
#define rfl(i,a,b) for(ll i=a;i>b;i--)
#define pb push_back
#define mp make_pair
#define test ll t;cin>>t;while(t--)
#define lld long double
#define vpp vector<pair<ll,ll>>
#define pii pair<ll,ll>
#define ff first
#define ss second
#define endl '\n'
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
const ll M =1000000007;
const double pi  =acos(-1);
const int N = 2e5 + 10;
int main()
{
    CoDeFoRcEs_and_ChIlL;
    ll n,t,ans=0;
    cin>>n>>t;
    double a[15][15];
    memset(a,0,sizeof(a));
    a[1][1]=t;
    fl(i,1,n+1)
    {
        for(ll j=1;j<=i;j++)
        {
            if(a[i][j]>=1)
            {
                double q=a[i][j]-1;
                a[i+1][j]+=q/2;
                a[i+1][j+1]+=q/2;
                a[i][j]=1;
                ans++;
            }
        }
    }
    cout<<ans;
}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> int2;
const int Inf = 1e9+7;
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcountll __popcnt64
#endif
#define mp make_pair
#define endl '\n'

const int N = 57;
int n, t;
double a[N][N];

void solve()
{
    cin >> n >> t;

    int res = 0;
    for (int k = 0; k < t; ++k) {
        a[0][0] += 1.0;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                if (a[i][j] >= 1.0) {
                    double d = a[i][j]-1.0;
                    a[i+1][j] += d/2;
                    a[i+1][j+1] += d/2;
                    a[i][j] = 1.0;
                }
            }
        }
        /*cout << k+1 << endl;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) cout << a[i][j] << " ";
            cout << endl;
        }
        cout << endl;*/
        res = 0;
        for (int i = 0; i < n; ++i)
            for (int j = 0; j < n; ++j)
                if (a[i][j] >= 1.0) ++res;
        if (res >= 55) break;
    }
    cout << res << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(12);
    cout << fixed;

    solve();
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int UNIT = 2048;

int n, t, res, x[20][20];

int main()
{
	cin >> n >> t;

	x[1][1] = t*UNIT;

	for (int i = 1; i <= n; ++i)
	for (int j = 1; j <= i; ++j)
	{
		if (x[i][j] >= UNIT)
		{
			x[i+1][j] += (x[i][j] - UNIT) / 2;
			x[i+1][j+1] += (x[i][j] - UNIT) / 2;
			++res;
		}
	}

	cout << res;
	return 0;
}

///============================================================================///
///                                                                            ///
///                            IT'S ME                                         ///
///                         BISHAL GAUTAM                                      ///
///                  CSE,JAHANGIRNAGAR UNIVERSITY,DHAKA                        ///
///               "Follow Excellence..Success will chase U"                    ///
///                                                                            ///
///============================================================================///
#include<bits/stdc++.h>
#define PI acos(-1.0)
#define X first
#define Y second
#define mpp make_pair
#define nl printf("\n")
#define SZ(x) (int)(x.size())
#define pb(x) push_back(x)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>

///==Scanning====///
#define S(a) scanf("%d",&a)
#define P(a) printf("%d",a)
#define SL(a) scanf("%lld",&a)
#define S2(a,b) scanf("%d%d",&a,&b)
#define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define SL2(a,b) scanf("%lld%lld",&a,&b)
#define SL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)

///==Arr,Vec Functions==///
#define all(v) v.begin(),v.end()
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a) memset(a,-1,sizeof(a))
#define CPY(a,b) memcpy(a,b,sizeof(a))
#define MAX(a) (*max_element(all(a)))
#define MIN(a) (*min_element(all(a)))
#define fv(i,v)  for(int i=0;i<(int)v.size();i++)
#define fr(i,a,n) for(int i=a;i<=n;i++)
#define rf(i,n,a) for(int i=n;i>=a;i--)

///===Some Useful====///
#define OnBit(a) __builtin_popcountll((ll)a)
#define LB(v,k) lower_bound(v.begin(),v.end(),k)
#define _cin ios_base::sync_with_stdio(0),cin.tie(0)
#define dbg(x) cerr<<__LINE__<< ":: "<<#x<<"= "<<x<<endl
#define UNIK(v) sort(all(v)),v.resize( unique(all(v)) -v.begin() );
#define fi(n) for(__typeof(n.begin()) it=n.begin();it!=n.end();it++)
#define IO freopen("A.in","r",stdin),freopen("Out.out","w",stdout)
using namespace std;

///===TypeDefs=====///
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<pii> vii;

///===Number Theory===///
//template< class T > inline T SQR(T a) { return ((a)*(a)); }
//template< class T > inline T gcd(T a,T b) {a=abs(a);b=abs(b); if(!b) return a; return gcd(b,a%b);}
//template< class T > inline T lcm(T a,T b) {a=abs(a);b=abs(b); return (a/_gcd(a,b))*b;}
//template<typename T> T POW(T b,T p) {T r=1; while(p){if(p&1)r=(r*b);b=(b*b);p>>=1;}return r;}
//template<typename T> T BigMod(T b,T p,T m) {T r=1; while(p){if(p&1)r=(r*b)%m;b=(b*b)%m;p>>=1;}return r;}
//template<typename T> T ModInverse(T n,T m) { return BigMod(n,m-2,m); }
//
/////==GeoMetry=========///
//double DEG(double x) { return (180.0*x)/(PI);}
//double RAD(double x) { return (x*(double)PI)/(180.0);}
//template<typename T> double DIS(T a,T b){ return sqrt((double)( SQR(a.X-b.X)+ SQR(a.Y-b.Y))); }
//template<typename T> T ANGLE(T a,T b){ return atan( double(a.Y-b.Y) / double(a.X-b.X));}
//template<typename T> int isLeft(T a,T b,T c) { return (c.X-a.X)*(b.Y-a.Y)-(b.X-a.X)*(c.Y-a.Y); }
//
/////===IO-Related===///
//template< class T > void prnt(T v) { fv(i,v) {if(!i)cout<<v[i];else cout<<" "<<v[i];} cout<<endl; }
//template< class T > void BIN(T n) { if(!n){nl;return;}BIN(n/2);cout<<(n%2); }
//template<typename T> T in(){ char ch; T n = 0; bool ng = false; while (1) { ch = getchar(); if (ch == '-') { ng = true; ch = getchar(); break;} if (ch>='0' && ch<='9') break; }    while (1) { n = n*10 + (ch - '0'); ch = getchar(); if (ch<'0' || ch>'9')   break;    }  return (ng?-n:n);  }

///====Some-Stuff===///
/// atoi( str.c_str() ); // char string to int
/// sprintf(str,"%d",num);// num to char string
///int month[]={-1,31,28,31,30,31,30,31,31,30,31,30,31}; //Not Leap Year
///int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
///int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 Direction
///int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

/**************************************************************************************
 * ///////////////////////////////////////////////////////////////////////////////////*
 *************************************************************************************/

///==========CONSTANTS==============///
///  Digit     0123456789*#@%&^$"-  ///
#define MX     1002
#define inf    1000000010
#define MD     1000000007LL
#define eps    1e-9
///================================///

int ar[MX+2][MX+2];
int main() {
    int n,t,i,j;
    S2(n,t);
    if(t<=1) {
        printf("%d\n",t);
        return 0;
    }
    int bg=(1<<16);
    for(int tt=1; tt<=t; tt++) {
        ar[1][1]+=bg;
        for(i=1; i<=n; i++) {
            for(j=1; j<=i; j++) {
                if( ar[i][j]>=bg ){
                    int ex=(ar[i][j]-bg)/2;
                    ar[i][j]=bg;
                    ar[i+1][j]+=ex;
                    ar[i+1][j+1]+=ex;
                }
            }
        }
    }
    int ans=0;
    fr(i,1,n) {
        fr(j,1,i) {
           // cout<<ar[i][j]<< " ";
            if( ar[i][j]==bg )ans++;
        }
       // nl;
    }
    printf("%d\n",ans);

    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <set>
#include <map>
#include <cassert>
#include <cstring>
#include <cstdio>
#include <cstdlib>
using namespace std;

double dp[11][11];
int main() {
	//~ ios::sync_with_stdio(0);
	//~ cin.tie(0);

	int n, t;
	scanf("%d%d", &n, &t);

	int ans = 0;
	dp[0][0] = t;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= i; j++) {
			if (dp[i][j] >= 1) {
				ans++;
				dp[i+1][j] += (dp[i][j] - 1) / 2;
				dp[i+1][j+1] += (dp[i][j] - 1) / 2;
			}
		}
	}
	printf("%d\n", ans);
}

          #include <bits/stdc++.h>
            using namespace std;

            int main() {
                  ios_base::sync_with_stdio(false);
                     cin.tie(NULL);
                      cout.tie(NULL);
            	int n,t;
            	cin>>n>>t;
            	int x;
                double M[15][15];
                	for(int i=0;i<15;++i){
            			for(int j=0;j<15;++j) {
            	           M[i][j]=0;
            			}
               }

            	while(t--) {
            		M[1][1] += 1;
            		for(int i=1;i<=n;++i){
            			for(int j=1;j<=i;++j) {
            				if(M[i][j] > 1) {
            				  double x = M[i][j] - 1;
            					M[i][j] = 1;
            					M[i+1][j] += x/2;
            					M[i+1][j+1] += x/2;
            				}
            			}
            		}
            	}

            	x = 0;
            	for(int i=1;i<=n;++i){
            		for(int j=1;j<=i;++j){
            			if(M[i][j] == 1)
            				++x;
            		}}

            	cout<<x<<"\n";

            	return 0;
            }

/*
 https://vjudge.net/contest/209061#problem/F
*/
#include<bits/stdc++.h>
using namespace std;

#define   M             100005
#define   ll            long long
#define   PI            atan(1.0)*4
#define   mst(x,v)      memset(x,v,sizeof(x))
#define   inf           (int)1e9

typedef   pair<int,int> P;

double w[11][11];

int main() {

	int n,t;
	scanf("%d %d",&n,&t);

	w[1][1]=t;
	for(int i=1;i<=n;i++) {
		for(int j=1;j<=i;j++) {
			if(w[i][j]>1) {
				double temp=w[i][j]-1;
				w[i+1][j] += temp/2;
				w[i+1][j+1] += temp/2;
			}
		}
	}

	int ans=0;
	for(int i=1;i<=n;i++) {
		for(int j=1;j<=i;j++) {
			if(w[i][j]>=1)
				ans++;
		}
	}

	printf("%d\n",ans);

}

#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define ll long long int
using namespace std;
void fast()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int main()
{
    fast();
    int n,t; cin>>n>>t;
    int val=1<<n;
    int dp[n+2][n+2];
    memset(dp,0,sizeof(dp));
    for(int i=0;i<t;i++)
    {
        dp[1][1]+=val;
        for(int j=1;j<=n;j++)
        {
            for(int k=1;k<=j;k++)
            {
                if(dp[j][k]>val)
                {
                    int diff=dp[j][k]-val;
                    dp[j+1][k]+=diff/2;
                    dp[j+1][k+1]+=diff/2;
                    dp[j][k]=val;
                }
            }
        }
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            if(dp[i][j]==val) cnt++;
        }
    }
    cout<<cnt;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
double ar[12][22]={0};

int main()
{

	int n;
	double t;
	cin>>n>>t;
	if(t==0)
	cout<<0<<endl;
	else if(t>=1023)
	cout<<(n*(n+1))/2<<endl;
	else
	{
		ar[1][1]=t;
		int ans=0;
		for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=i;j++)
			{
				if(ar[i][j]>=1)
				{
					ans++;
					ar[i+1][j]+=(ar[i][j]-1)/2;
					ar[i+1][j+1]+=(ar[i][j]-1)/2;
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <string>

#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <stack>
#include <deque>
#include <list>

#define endl '\n'

typedef long long ll;

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

 	ll t, n, m, tmp, ans = 0, sum = 0;

 	cin >> n >> t;

 	int limit = pow(2, n);

 	vector<vector<int>> cups;

 	for (int i = 1; i <= n; i++) {
 		cups.push_back(vector<int>(i, 0));
 	}

 		cups[0][0] = limit * t;

 		// divide surplus between two cups underneath...

 		for (int row = 0; row < n; row++) {

 			// todo: take care of the last row...

 			for (int col = 0; col < row + 1; col++) {
 				if (cups[row][col] > limit && row < n - 1) {
 					int surplus = cups[row][col] - limit;
 					cups[row][col] = limit;

 					cups[row + 1][col] += surplus / 2;
 					cups[row + 1][col + 1] += surplus / 2;
 				}
 			}
 		}

 	for (int i = 0; i < n; i++) {
 		for (int j = 0; j < i + 1; j++) {
 			if (cups[i][j] >= limit) {
 				ans++;
 			}
 		}
 	}

 	cout << ans;
}

#include <iostream>
    #include<vector>
    #include<math.h>
    using namespace std;

    int main() {
    	// your code goes here
    	int n,t;
    	cin>>n>>t;
    	int ans=0;
    vector<vector<long double>>p;
    vector<long double>h;
    h.push_back(t);
    p.push_back(h);
    for(int i=1;i<=n;i++)
    {vector<long double>h1;
    	for(int j=0;j<=i;j++)
    	{
    	h1.push_back(0);
    	}
    	p.push_back(h1);
    }
    for(int i=0;i<n;i++)
    {
    	for(int j=0;j<=i;j++)
    	{
    		if(p[i][j]>1)
    		{
    			p[i+1][j]+=(p[i][j]-1)/(long double)2;
    			p[i+1][j+1]+=(p[i][j]-1)/(long double)2;
    			p[i][j]=(long double)1;
    		}
    	}
    }
    for(int i=0;i<n;i++)

    {
    	for(int j=0;j<=i;j++)
    	{
    		if(p[i][j]>=1)ans++;
    	}
    }
    cout<<ans<<endl;
    return 0;}

#include <bits/stdc++.h>
#define ll long long
#define mx 1000000007
using namespace std;

int main()
{
    ll n,k;
    cin>>n>>k;
    ll i,j,c=0;
    vector<vector<double>> a(12,vector<double>(12,0));
    a[1][1]=k;
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=i;j++)
        {
            if(a[i][j]>=1)
            {
                a[i+1][j]+=(a[i][j]-1)/2;
                a[i+1][j+1]+=(a[i][j]-1)/2;
                c++;
            }
        }
    }
    cout<<c;
}

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#define ll long long int
#define ull unsigned long long int

using namespace std;

double dp[60][60];

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    // std::ios_base::sync_with_stdio(false);
    ll n,i,j,t,c=0;
    cin>>n>>t;
    dp[1][1] = t;

    for(i=2;i<=n;i++)
    {
        for(j=1;j<=i;j++)
        {
            dp[i][j] = max(0.0,(dp[i-1][j-1]-1)/2.0) + max(0.0,(dp[i-1][j]-1)/2.0);
            if(dp[i][j]>=1) c++;
        }
    }
    if(dp[1][1]>=1) c++;
    cout<<c<<endl;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define ull  unsigned long long
typedef string str;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define fi first
#define se second
#define ins insert
#define all(x) (x).begin(), (x).end()
#define fr(i, n) for(int i = 0; i < n; i++)
#define rall(x) (x).rbegin(), (x).rend()
#define speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int INF = 1e9 + 5;

int a[21][21], b[21][21];

int main(){

	int n,m;
	cin >> n >> m;
	int init = 1024;
   for (int k = 1;k <= m;k++){
  	   b[1][1] = 1024;
	    for (int i = 1;i <= n;i++)
		   for (int j = 1;j <= i;j++){
			if (a[i][j] + b[i][j] <= 1024){
			    a[i][j] += b[i][j];
				b[i][j] = 0;
				continue;
			}
			b[i][j] -= (1024 - a[i][j]);
			a[i][j] = 1024;
			b[i+1][j] += b[i][j] / 2;
			b[i+1][j+1] += b[i][j] / 2;
			b[i][j] = 0;
		}
	}
    int ans = 0;
    for (int i = 1;i <= n; i++)
        for (int j = 1;j <= i; j++)
            if (a[i][j] == 1024) ans++;

 cout << ans << endl;

}

#include <bits/stdc++.h>

using namespace std;

double cup[15][15] = {0};
int n,t;

void pour(int x,int y,double water)
{
    double more;
    if(x > n) {
        return ;
    }
    cup[x][y] += water;
    if(cup[x][y] > 1) {
        more = cup[x][y] - 1;
        cup[x][y] = 1;
        pour(x+1,y+1,more/2);
        pour(x+1,y,more/2);
    }
}

int main()
{
    while(~scanf("%d %d",&n,&t)) {
        memset(cup,0,sizeof(cup));
        for(int i = 1; i <= t; i ++ ) {
            pour(1,1,1);
        }
        int ans = 0;
        for(int i = 1; i <= n; i ++ ) {
            for(int j = 1; j <= i; j ++ ) {
                if(cup[i][j] == 1) {
                    ans ++;
                }
            }
        }
        printf("%d\n",ans);
    }
    return 0;
}
/*2017-10-19 21:58:50.811*/

#include <bits/stdc++.h>

using namespace std;

int n,t ;
double v[11][11] ;

void fun(int i , int j , double p)
{
    if (i==n) return ;

    if(p+v[i][j]<=1.0)
        v[i][j]+=p ;

    else
    {
        v[i][j]=1.0 ;
        double r= p - (1- v[i][j]) ;
        fun(i+1,j,r/2) ;
        fun(i+1,j+1,r/2);
    }
}

int main()
{
    cin>>n>>t ;
    int res=0 ;
    memset(v,0.0,sizeof v);

    while(t--)
        fun(0,0,1.0);
    for(int i=0 ; i<n ; i++)
    {
        for(int j=0;j<=i ; j++)
            if (v[i][j]>= 1.0 )res++;

    }

    cout<<res<<endl ;
    return 0;
}

///HEADER FILES///

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cctype>
#include<stack>
#include<queue>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<iostream>
#include<algorithm>
#include<sstream>
#include<cstdlib>
#include<complex>
#include<iomanip>
#include<utility>
#include<bitset>
#include<list>
#include<assert.h>
#include<numeric>
#include<fstream>
using namespace std;

///DEFINES///

///ALWAYS USEFUL
#define     caseprint(case)     printf("Case %d: ", case++)
#define     clr(a)              memset(a, 0, sizeof(a))
#define     mem(a, b)           memset(a, b, sizeof(a))
#define     pb                  push_back
#define     pp                  pop_back
#define     ful_vec(v)          v.begin(), v.end()
#define     sort_vec(v)         sort(fulvec(v))
#define     sf                  scanf
#define     pf                  printf
#define     NL                  pf("\n")
#define     sz(a)               (int)a.size()
#define     bitcheck(n, pos)    (n & (1<<(pos)))
#define     biton(n, pos)       (n | (1<<(pos)))
#define     bitoff(n, pos)      (n & ~(1<<(pos)))
#define     sqr(a)              ((a)*(a))

///SCAN
#define     sfs(a)              scanf("%s", &a)
#define     sfi1(a)             scanf("%d", &a)
#define     sfi2(a, b)          scanf("%d %d", &a, &b)
#define     sfi3(a, b, c)       scanf("%d %d %d", &a, &b, &c)
#define     sfi4(a, b, c, d)    scanf("%d %d %d %d", &a, &b, &c, &d)
#define     sfd1(a)             scanf("%lf", &a)
#define     sfd2(a, b)          scanf("%lf %lf", &a, &b)
#define     sfd3(a, b, c)       scanf("%lf %lf %lf", &a, &b, &c)
#define     sfd4(a, b, c, d)    scanf("%lf %lf %lf %lf", &a, &b, &c, &d)
#define     sfll1(a)            scanf("%lld", &a)
#define     sfll2(a, b)         scanf("%lld %lld", &a, &b)
#define     sfll3(a, b, c)      scanf("%lld %lld %lld", &a, &b, &c)
#define     sfll4(a, b, c, d)   scanf("%lld %lld %lld %lld", &a, &b, &c, &d)
#define     sfull1(a)           scanf("%llu", &a)
#define     sfull2(a, b)        scanf("%llu %llu", &a, &b)
#define     sfull3(a, b, c)     scanf("%llu %llu %llu", &a, &b, &c)
#define     sfull4(a, b, c, d)  scanf("%llu %llu %llu %llu", &a, &b, &c, &d)

///GEOMETRY
#define     ang(a, b, c)            acos((sqr(b)+sqr(c)-sqr(a))/(2.0*b*c))
#define     dist(x1, y1, x2, y2)    sqrt(sqr(x1-x2)+sqr(y1-y2))

///TYPES///
typedef     long long           ll;
typedef     unsigned long long  ull;

///TEMPLATES///
template<class T1>void check(T1 e)
{
    cout <<"-->"<< e << endl;
}
template<class T1, class T2> void check(T1 e1, T2 e2)
{
    cout <<"-->"<< e1 << " " << e2 << endl;
}
template<class T1, class T2, class T3> void check(T1 e1, T2 e2, T3 e3)
{
    cout <<"-->"<< e1 << " " << e2 << " " << e3 << endl;
}
template<class T1, class T2, class T3, class T4> void check(T1 e1, T2 e2, T3 e3, T4 e4)
{
    cout <<"-->"<< e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template<class T1, class T2, class T3, class T4, class T5> void check(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5)
{
    cout <<"-->"<< e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template<class T1, class T2, class T3, class T4, class T5, class T6> void check(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6)
{
    cout <<"-->"<< e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6 << endl;
}

//ll extGcd(ll a, ll b, ll& x, ll& y){if (b == 0){x = 1;y = 0;return a;}else{int g = extGcd(b, a % b, y, x);y -= a / b * x;return g;}}
//ll modInv(ll a, ll m){ll x, y; extGcd(a, m, x, y); x %= m; while (x < 0){x += m;} return x;}
//ll bigmod(ll a,ll b,ll m){if(b == 0) return 1%m;ll x = bigmod(a,b/2,m);x = (x * x) % m;if(b % 2 == 1) x = (x * a) % m;return x;}
//ll BigMod(ll B,ll P,ll M){ ll R=1%M; while(P>0) {if(P%2==1){R=(R*B)%M;}P/=2;B=(B*B)%M;} ret urn R;} /// (B^P)%M

//int x[] = {0,0,-1,1};//4-ways
//int y[] = {1,-1,0,0};//4-ways
//int x[] = {-1,-1,-1,0,0,1,1,1};//8-ways
//int y[] = {-1,0,1,-1,1,-1,0,1};//8-ways
//int x[] = {-2,-2,2,2,1,1,-1,-1};//knight moves
//int y[] = {1,-1,1,-1,2,-2,2,-2};//knight moves

///CONSTANTS
#define     pi                  acos(-1.0)
#define     ex                  exp(1)
#define     oo                  (1<<30)

///OTHERS
#define     accelerate          ios::sync_with_stdio(false)
#define     debug               printf("Ok\n")
#define     deb(a)              printf("=*=*=>%d\n", a);
#define     MOD                 1000000007
#define     M                   500000

double calc(int r, int c, double n)
{
    double glass[100];
    clr(glass);
    int x=0;
    glass[x]=n;
    int i, j;
    for(i=1; i<=r && n>=0.0; i++)
    {
        for(j=1; j<=i; j++)
        {
            n=glass[x];
            glass[x]=(n>=1.0)?1.0:n;
            n=(n>=1.0)?(n-1.0):0.0;
            glass[x+i]+=n/2.0;
            glass[x+i+1]+=n/2.0;
            x++;
        }
    }
    int no=(r*(r-1)/2)+c-1;
    return glass[no];
}

int main()
{
    int n, t;
    while(sfi2(n, t)==2)
    {
        int i, j, k, c=0;
        for(i=1; i<=n; i++)
        {
            for(j=1; j<=i; j++)
            {
                if(calc(i, j, t)==1.0) c++;
            }
        }
        pf("%d\n", c);
    }

    return 0;
}

#include <fstream>
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
using namespace std;

typedef long long ll;

double arr[12][12];

int main() {

    int n,t;
    cin >> n >> t;

    for(int q = 0; q < t; q++)
    {
        arr[1][1] += 1;
        for(int i = 1; i <= n; i++)
        {
            for(int j = 1; j <= i; j++)
            {
                if(arr[i][j] > 1)
                {
                    double more = arr[i][j] - 1;
                    arr[i][j] = 1;
                    arr[i+1][j] += more / 2;
                    arr[i+1][j+1] += more / 2;
                }
            }
        }
    }

    int rest = 0;

    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j<= i; j++)
        {
            if(arr[i][j] >= 1) rest++;
        }
    }

    cout << rest;

    return 0;
}

///HEADER FILES///

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cctype>
#include<stack>
#include<queue>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<iostream>
#include<algorithm>
#include<sstream>
#include<cstdlib>
#include<complex>
#include<iomanip>
#include<utility>
#include<bitset>
#include<list>
#include<assert.h>
#include<numeric>
#include<fstream>
using namespace std;

///DEFINES///

///ALWAYS USEFUL
#define     caseprint(case)     printf("Case %d: ", case++)
#define     clr(a)              memset(a, 0, sizeof(a))
#define     mem(a, b)           memset(a, b, sizeof(a))
#define     pb                  push_back
#define     pp                  pop_back
#define     ful_vec(v)          v.begin(), v.end()
#define     sort_vec(v)         sort(fulvec(v))
#define     sf                  scanf
#define     pf                  printf
#define     NL                  pf("\n")
#define     sz(a)               (int)a.size()
#define     bitcheck(n, pos)    (n & (1<<(pos)))
#define     biton(n, pos)       (n | (1<<(pos)))
#define     bitoff(n, pos)      (n & ~(1<<(pos)))
#define     sqr(a)              ((a)*(a))

///SCAN
#define     sfs(a)              scanf("%s", &a)
#define     sfi1(a)             scanf("%d", &a)
#define     sfi2(a, b)          scanf("%d %d", &a, &b)
#define     sfi3(a, b, c)       scanf("%d %d %d", &a, &b, &c)
#define     sfi4(a, b, c, d)    scanf("%d %d %d %d", &a, &b, &c, &d)
#define     sfd1(a)             scanf("%lf", &a)
#define     sfd2(a, b)          scanf("%lf %lf", &a, &b)
#define     sfd3(a, b, c)       scanf("%lf %lf %lf", &a, &b, &c)
#define     sfd4(a, b, c, d)    scanf("%lf %lf %lf %lf", &a, &b, &c, &d)
#define     sfll1(a)            scanf("%lld", &a)
#define     sfll2(a, b)         scanf("%lld %lld", &a, &b)
#define     sfll3(a, b, c)      scanf("%lld %lld %lld", &a, &b, &c)
#define     sfll4(a, b, c, d)   scanf("%lld %lld %lld %lld", &a, &b, &c, &d)
#define     sfull1(a)           scanf("%llu", &a)
#define     sfull2(a, b)        scanf("%llu %llu", &a, &b)
#define     sfull3(a, b, c)     scanf("%llu %llu %llu", &a, &b, &c)
#define     sfull4(a, b, c, d)  scanf("%llu %llu %llu %llu", &a, &b, &c, &d)

///GEOMETRY
#define     ang(a, b, c)            acos((sqr(b)+sqr(c)-sqr(a))/(2.0*b*c))
#define     dist(x1, y1, x2, y2)    sqrt(sqr(x1-x2)+sqr(y1-y2))

///TYPES///
typedef     long long           ll;
typedef     unsigned long long  ull;

///TEMPLATES///
template<class T1>void check(T1 e)
{
    cout <<"-->"<< e << endl;
}
template<class T1, class T2> void check(T1 e1, T2 e2)
{
    cout <<"-->"<< e1 << " " << e2 << endl;
}
template<class T1, class T2, class T3> void check(T1 e1, T2 e2, T3 e3)
{
    cout <<"-->"<< e1 << " " << e2 << " " << e3 << endl;
}
template<class T1, class T2, class T3, class T4> void check(T1 e1, T2 e2, T3 e3, T4 e4)
{
    cout <<"-->"<< e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template<class T1, class T2, class T3, class T4, class T5> void check(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5)
{
    cout <<"-->"<< e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template<class T1, class T2, class T3, class T4, class T5, class T6> void check(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6)
{
    cout <<"-->"<< e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6 << endl;
}

//ll extGcd(ll a, ll b, ll& x, ll& y){if (b == 0){x = 1;y = 0;return a;}else{int g = extGcd(b, a % b, y, x);y -= a / b * x;return g;}}
//ll modInv(ll a, ll m){ll x, y; extGcd(a, m, x, y); x %= m; while (x < 0){x += m;} return x;}
//ll bigmod(ll a,ll b,ll m){if(b == 0) return 1%m;ll x = bigmod(a,b/2,m);x = (x * x) % m;if(b % 2 == 1) x = (x * a) % m;return x;}
//ll BigMod(ll B,ll P,ll M){ ll R=1%M; while(P>0) {if(P%2==1){R=(R*B)%M;}P/=2;B=(B*B)%M;} ret urn R;} /// (B^P)%M

//int x[] = {0,0,-1,1};//4-ways
//int y[] = {1,-1,0,0};//4-ways
//int x[] = {-1,-1,-1,0,0,1,1,1};//8-ways
//int y[] = {-1,0,1,-1,1,-1,0,1};//8-ways
//int x[] = {-2,-2,2,2,1,1,-1,-1};//knight moves
//int y[] = {1,-1,1,-1,2,-2,2,-2};//knight moves

///CONSTANTS
#define     pi                  acos(-1.0)
#define     ex                  exp(1)
#define     oo                  (1<<30)

///OTHERS
#define     accelerate          ios::sync_with_stdio(false)
#define     debug               printf("Ok\n")
#define     deb(a)              printf("=*=*=>%d\n", a);
#define     MOD                 1000000007
#define     M                   500000

double glass[1000];

void calc(int r, double n)
{
    clr(glass);
    int x=1;
    glass[x]=n;
    int i, j;
    for(i=1; i<=r && n>=0.0; i++)
    {
        for(j=1; j<=i; j++)
        {
            n=glass[x];
            glass[x]=(n>=1.0)?1.0:n;
            n=(n>=1.0)?(n-1.0):0.0;
            glass[x+i]+=n/2.0;
            glass[x+i+1]+=n/2.0;
            x++;
        }
    }
}

int main()
{
    int n;
    double t;
    while(sfi1(n)==1)
    {
        sfd1(t);
        int i, j, k, c=0;
        calc(n, t);
        for(i=1; i<=(n*(n+1))/2; i++)
        {
            if(glass[i]>=1.0) c++;
            //pf("%lf\n", glass[i]);
        }
        pf("%d\n", c);
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int recur(vector<vector<double>> &A,int n,int t)
{
	if(t==1)
	{

		A[0][0]=1.0;
		return 1;
	}
	int count=recur(A,n,t-1);
	int i=log2(t);

	for(int j=0;j<=i;j++)
	{
		if(j>0)
		A[i][j]=A[i][j]+1/pow(2.0,i);

		if(i!=j)
		A[i][j]=A[i][j]+1/pow(2.0,i);

		if(A[i][j]>=1){

		count++;
		A[i][j]=-100.0;

		}

	}

	return count;

}
int main()
{
	int n,t;
	cin>>n>>t;
	if(t==0)
	{
		cout<<"0";
		return 0;
	}
	int x=pow(2,n)-1;
	if(t>x)
	{
		cout<<n*(n+1)/2;
		return 0;
	}

	vector<vector<double>> A(n,vector<double>(n,0));
	cout<<recur(A,n,t);
}

#include <stdio.h>
inline abs (float a) {
    return a < 0 ? -a : a;
}
inline max (float a, float b) {
    return a > b ? a : b;
}
int main() {
    short int n, t, ans = 0;
    scanf("%hi%hi", &n, &t);
    float T[10][10];
    T[0][0] = 1;
    for (short int lvl = 1, pow2 = 2; lvl < n; lvl++, pow2 <<= 1)
        for (short int i = 0; i < ((lvl + 2) >> 1); i++) {
            if (!i) T[lvl][i] = T[lvl - 1][0] + pow2;
            else if (i == ((lvl + 2) >> 1) - 1 && !(lvl & 1))
                T[lvl][i] = T[lvl - 1][i - 1] + pow2 / 2.;
            else T[lvl][i] = max(T[lvl - 1][i], T[lvl - 1][i - 1]) +
                            (pow2 * 1. - abs(T[lvl - 1][i] - T[lvl - 1][i - 1])) / 2.;
        }

    short int lvl;
    for (lvl = 0; lvl < n && (int) T[lvl][0] <= t; lvl++)
        ans += lvl + 1;
    if (lvl < n && (int) T[lvl][0] > t)
        for (short int i = 1; i < ((lvl + 2) >> 1); i++) {
            ans += (((short int) T[lvl][i] <= t) << 1);
            if (i == ((lvl + 2) >> 1) - 1 && !(lvl & 1) && (int) T[lvl][i] <= t)
                ans--;
        }
    printf("%hi", ans);
}

#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define endl "\n"
typedef long long int ll;

int main(){
  //  printPascal(10);
    int n;
    double t;
    cin >> n >> t;
    int cont=0;
    double G[15][15];
    G[1][1]=t;

    for(int i =1; i<=n; ++i)
        for(int j =1; j<=i; ++j){
            if(G[i][j] >= (double)1){
                ++cont;
                G[i+1][j]  += (G[i][j] - (double)1)/(double)2;
                G[i+1][j+1]+= (G[i][j] -(double)1)/(double)2;
            }

        }
    cout << cont << endl;
    return 0;
}

#include <bits/stdc++.h>

#define ff first
#define ss second
#define maxn 100009
#define ll long long
#define pb push_back
#define inf 1000000009
#define ppb() pop_back()
#define pii pair <int , int>
#define all(x) x.begin(),x.end()
#define llinf 1000000000000000009
#define tr(i, c) for(__typeof(c).begin() i = (c).begin() ; i != (c).end() ; i++)
using namespace std;
int a, b, ans;
double c[10][10];
int main () {
	//freopen ("file.in", "r", stdin);
	//freopen ("file.out", "w", stdout);

 	//srand ((unsigned) time ( NULL ));
	//int randomNumber = rand() % 10 + 1;
	cin >> a >> b;
	c[1][1] = b;

	for (int i = 1; i <= a; i++) {
		for (int j = 1; j <= i; j++) {
			double x = c[i][j];
			x --;
			x /= 2;

			c[i + 1][j + 1] += x;
			c[i + 1][j + 0] += x;
		}
	}

	for (int i = 1; i <= a; i++)
		for (int j = 1; j <= i; j++)
			if (c[i][j] >= 1)
				ans ++;

	cout << ans << endl;
	return 0;
}

#include <cstdio>
using namespace std;
struct Pos {
	int x,y;
};

int n,m,q,mode,tmp1,tmp2,tmp3;
Pos a[110][110];
int out[110][110];
Pos tmp[110];
/*void DEBUGCD() {
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=m; j++)
			printf("(%d,%d)  ",a[i][j].x,a[i][j].y);
		printf("\n");
	}
}*/

int main() {
	//freopen("matrix.in","r",stdin);
	//freopen("matrix.out","w",stdout);
	scanf("%d%d%d",&n,&m,&q);
	for(int i=1; i<=n; i++)
		for(int j=1; j<=m; j++)
			a[i][j]= {i,j};
	for(register int i=1; i<=q; i++) {
		//DEBUGCD();
		scanf("%d",&mode);
		if(mode==1) {
			scanf("%d",&mode);
			for(int j=1; j<=n; j++) tmp[j]=a[mode][j%n+1];
			for(int j=1; j<=n; j++) a[mode][j]=tmp[j];
		} else if(mode==2) {
			scanf("%d",&mode);
			for(int j=1; j<=m; j++) tmp[j]=a[j%m+1][mode];
			for(int j=1; j<=m; j++) a[j][mode]=tmp[j];
		} else if(mode==3) {
			scanf("%d%d%d",&tmp1,&tmp2,&tmp3);
			out[a[tmp1][tmp2].x][a[tmp1][tmp2].y]=tmp3;
		}
	}
	for(int i=1; i<=n; i++) {
		printf("%d",out[i][1]);
		for(int j=2; j<=m; j++)
			printf(" %d",out[i][j]);
		printf("\n");
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n,k;
    cin>>n>>k;
    vector<vector<double>>v;
    for(int i=1;i<=n;i++)
    {
        v.push_back(vector<double>(i,0.00));
    }
    v[0][0] = (double)k * 100.00;
    int ans = 1;
    if(k==0)ans=0;

    for(int i=0;i<v.size()-1;i++)
    {
        for(int j=0;j<v[i].size();j++)
        {
            if(v[i][j] > 100.00)
            {
                ans++;
                double extra = v[i][j] - 100.00;
                double toDistibute = (double)(extra/2.00);
                v[i+1][j]+=toDistibute;
                v[i+1][j+1]+=toDistibute;

            }
        }
    }
    int i = v.size()-1;
    for(int j = 0;j<v[i].size();j++)
    {
        if(v[i][j]>=100)ans++;
    }

    cout<<ans<<endl;

}

#include <bits/stdc++.h>

using namespace std;
long long n,t,ans=0,sum=0;
double a[10][10];
void build(int i,int j,double val)
{

    if(i>=10) return;
    if(a[i][j]!=(int)1)
    {
        a[i][j]+=val;
    }
    else
    {
        build(i+1,j-1,val/2);
        build(i+1,j+1,val/2);
    }

}
int main()
{
    /*long long n,a,en,beg;
    cin>>n;
    for(int i=0;i!=n;i++)
    {
        cin>>a;
        //v.push_back(a);
        if(a==1)
            beg=i;
        else if(a==n)
            en=i;
    }
    if(beg<en)
    {
        cout<<max(en,n-beg-1)<<endl;
    }
    else if(beg>en)
    {
        cout<<max(beg,n-en-1)<<endl;
    }*/
    /*long long n,k,beg=0,beg2=0,x=-1,y=-1;
    char c;
    vector<int> w,w2;
    cin>>n>>k;
    long long pref[n+1],pref2[n+1];
    pref[0]=0;
    pref2[0]=0;
    for(int i=1;i<=n;i++)
    {
        cin>>c;
        pref[i]=pref[i-1];
        if(c=='b')
            {pref[i]++;w.push_back(i);}
        pref2[i]=pref2[i-1];
        if(c=='a')
            {pref2[i]++;w2.push_back(i);}
    }
    int u=0,u2=0;
    for(int i=1;i<=n;i++)
    {
        if(pref[i]-pref[beg]>k)
        {
            //cout<<endl;
            x=max(x,i-beg-1);
            beg=w[u];
            u++;
        }
        if(pref2[i]-pref2[beg2]>k)
        {
            x=max(x,i-beg2-1);
            beg2=w2[u2];
            u2++;
        }
    }
    x=max(x,n-beg);
    y=max(y,n-beg2);
    if(x==-1) x=n;
    if(y==-1) y=n;
    cout<<max(x,y)<<endl;*/
    cin>>n>>t;
    for(int i=1;i<=n;i++)
        sum+=i;
    for(int i=1;i<=t;i++)
    {
        build(0,n,1);
    }
    for(int i=0;i!=10;i++)
    {
        for(int j=0;j!=10;j++)
        {
            if(a[i][j]==(int)1)
                ans++;
        }
    }
    cout<<min(ans,sum)<<endl;
    return 0;
}

#include <iostream>
#include <map>
#include<math.h>
using namespace std;
#define FOR(i,s,e) for (int i=(s); i<(e); i++)
#define FOE(i,s,e) for (int i=(s); i<=(e); i++)
#define ll long long
ll gcd(ll,ll);
int main()
{
	ll n, m, i = 1, k,o2,t,ans=0;
	double x,p;
	cin >> n >> m;
	k = n*(n + 1) / 2;
	if (m >= k)
	{
		cout << k;
		return 0;
	}
	k = 1;
	while (k <= m)
	{
		k = i*(i + 1) / 2;
		i++;
	}
	i = i - 2;
	k = i*(i + 1) / 2;
	ans = ans + k;
	i++;
	if (i >= 3)
	{
		o2 = i - 2;
		p = o2 * 2 + 2;
		x = 1 / p;
		i--;
		t = m - k;
		if ( 2 * x * t == 1 || 2 * x * t > 1)
			ans = ans + o2;
	}
	cout << ans;
	return 0;
}
ll gcd(ll u, ll v) {while (v != 0) {ll r = u % v;u = v;v = r;}return u;}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,t;
    cin>>n>>t;
    int sum=0,k;

   for(int i=1;i<=n;i++)
   {
        k=i;
       if(t>=2*(i-1)&&t>0)
       {
           sum+=i;
           t-=i;
       }
       else break;
   }
   if(t==k-1&&k>2) sum+=k-2;
   printf("%d\n",sum);

    return 0;
}

#include <iostream>
#include <cstdio>

using namespace std;

double a[15][15];
int main()
{
    //freopen("in.txt","r",stdin);
    int n,t;
    int ans=0;
    scanf("%d%d",&n,&t);
    a[0][0]=t;
    for(int i=0;i<n;i++){
        for(int j=0;j<=i;j++){
            if(a[i][j]>1){
                ans++;
                a[i+1][j]=(a[i][j]-1)/2;
                a[i+1][j+1]=(a[i][j]-1)/2;
            }
        }
    }
    printf("%d",ans);
    return 0;
}

        #include <iostream>
        #include<vector>
        #include<math.h>
        using namespace std;

        int main() {
        	// your code goes here
        	int n,t;
        	cin>>n>>t;
        	vector<vector<pair<int,int>>>v;
        vector<pair<int,int>>l;
        l.push_back({1,1});
        v.push_back(l);

        for(int j=2;j<=n;j++)
        {vector<pair<int,int>>k;
        	k.push_back({1,(v[j-2][0].second*2)});

        	for(int p=2;p<=j-1;p++)
        	{
        	int x=v[j-2][p-2].first;
        	int y=(v[j-2][p-2].second)*2;
        	int x1=v[j-2][p-1].first;
        	int y1=(
        		v[j-2][p-1].second)*2;

        	int u,b;

        if(y>y1)
        {
        	u=x+(y/y1)*x1;
        	b=y;
        }
        else
        {
        u=x1+(y1/y)*x;
        b=y1;
        }
        k.push_back({u,b});
        	}

        		k.push_back({1,(v[j-2][0].second*2)});
        		v.push_back(k);}

        		vector<vector<double>>w;
        		vector<double>m;
        		m.push_back(1);
        		w.push_back(m);

        for(int j=2;j<=n;j++)
        {vector<double>k;
        	k.push_back((double)w[j-2][0]*2+1);

        	for(int p=2;p<=j-1;p++)
        	{
        	int x=v[j-2][p-2].first;
        	int y=(v[j-2][p-2].second)*2;
        	int x1=v[j-2][p-1].first;
        	int y1=(v[j-2][p-1].second)*2;
        		int z=w[j-2][p-2];
        		int z1=w[j-2][p-1];
        	double u,b;
        if(y>y1)
        {
        	u=x+((double)y/y1)*x1;
        	b=y+(x*z+(x1*(double)y/y1)*z1);

        }
        else
        {
        u=x1+((double)y1/y)*x;
        b=y1+(x1*z1+(x*(double)y1/y)*z);

        }
        k.push_back((b/(double)u));
        	}

        	k.push_back((double)w[j-2][0]*2+1);
        		w.push_back(k);}
        		int ans=0;
        		for(int i=0;i<n;i++)
        		{
        			for(int j=0;j<=i;j++)
        			{

        				if(ceil(w[i][j])<=t)ans++;
        			}
        		}
        	cout<<ans<<endl;

        	return 0;
        }

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i = 0; i < n; ++i)
#define Rep(i,n) for(int i = 1; i <= n; ++i)
#define lowbit(x) ((x)&(-x))
//#pragma comment(linker,"/STACK:1024000000,1024000000")
#define eps 1e-6
#define sqr(x) ((x)*(x))
#define pb(x) push_back(x)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;

const int inf = 0x3f3f3f3f, mod = 1e9 + 7;
const int maxn = 2e5 +100;
const ld PI = acos(-1.0);
ll gcd (ll a, ll b)
{return ( a ? gcd(b%a, a) : b );}
ll power(ll a, ll n)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power(ll a, ll n, ll mod)
{ll p = 1;while (n > 0) {if(n%2) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;}
int n,m,all,k;
int a[maxn],flag[maxn];
int main()
{
    int kase=1;
    int t;
    while(~scanf("%d",&n))
    {
        for(int i=1;i<=n;i++)
            scanf("%d",&a[i]),flag[a[i]]=i;
        int s=max(n-flag[1],flag[1]-1);
        s=max(s,n-flag[n]);
        s=max(s,flag[n]-1);
        cout<<s<<endl;

    }

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

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

int main() {
    ll n, t;
    cin >> n >> t;
    vector<vector<ll>> tree(n + 1, vector<ll>(n + 1));
    tree[0][0] = t * (1 << n);
    ll ans = 0;
    for (ll i = 0; i < n; i++) {
        for (ll j = 0; j < n; j++) {
            ll now = tree[i][j] - (1 << n);
            if (now >= 0 && i + j < n) {
                ans++;
            }
            tree[i][j + 1] += now / 2;
            tree[i + 1][j] += now / 2;
        }
    }
    cout << ans;

    return 0;
}

#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <tuple>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <stdio.h>
#include <valarray>

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

#define forn(i,n) for(tint i=0;i<(tint)(n); i++)
#define forsn(i,s,n) for(tint i=(s);i<(tint)(n); i++)
#define esta(x,v) (find((v).begin(),(v).end(),(x)) !=  (v).end())
#define index(x,v) (find((v).begin(),(v).end(),(x)) - (v).begin())
#define debug(x) cout << #x << " = "  << x << endl

using namespace std;

void imprimirVector (vector<tint> v)
{
	if (!v.empty())
	{
		int p = v.size();
		cout << "[";
		forn(i,p-1)
			cout << v[i] << ",";
		cout << v[p-1] << "]" << endl;
	}
	else
		cout << "[]" << endl;
}

tint toNumber (string s)
{
	tint Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (tint number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main()
{
	#ifdef ACMTUYO
		assert(freopen("entrada.in", "r", stdin));
	#endif
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	tint n,t;
	while (cin >> n >> t)
	{
		tint k = 1;
		forn(i,n)
			k *= 2;
		if (t == 0)
			cout << 0 << "\n";
		else
		{
			vector<vector<tint> > glasses(n+1,vector<tint> (n+1));
			glasses[0][0] = k;
			set<pair<tint,tint> > activos = {{0,0}};
			set<pair<tint,tint> > newActivos = {{0,0}};
			forsn(s,1,t)
			{
				for (auto x : activos)
				{
					if (x.first < n)
					{
						tint r = k;
						forn(p,x.first)
							r /= 2;
						if (x.second == 0 or x.second == x.first)
							r /=2 ;
						glasses[x.first+1][x.second]   += r;
						glasses[x.first+1][x.second+1] += r;
						if (glasses[x.first+1][x.second] >= k && x.first < n-1)
							newActivos.insert({x.first+1,x.second});
						if (glasses[x.first+1][x.second+1] >= k && x.first < n-1)
							newActivos.insert({x.first+1,x.second+1});
					}
				}
				activos = newActivos;
			}
			cout << activos.size() << "\n";
		}
	}
	return 0;
}

/**************************************************************
    Problem:
    User: youmi
    Language: C++
    Result: Accepted
    Time:
    Memory:
****************************************************************/
//#pragma comment(linker, "/STACK:1024000000,1024000000")
//#include<bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
#include <stack>
#include <set>
#include <sstream>
#include <cmath>
#include <queue>
#include <deque>
#include <string>
#include <vector>
#define zeros(a) memset(a,0,sizeof(a))
#define ones(a) memset(a,-1,sizeof(a))
#define sc(a) scanf("%d",&a)
#define sc2(a,b) scanf("%d%d",&a,&b)
#define sc3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define scs(a) scanf("%s",a)
#define sclld(a) scanf("%I64d",&a)
#define pt(a) printf("%d\n",a)
#define ptlld(a) printf("%I64d\n",a)
#define rep(i,from,to) for(int i=from;i<to;i++)
#define irep(i,to,from) for(int i=to-1;i>=from;i--)
#define Max(a,b) ((a)>(b)?(a):(b))
#define Min(a,b) ((a)<(b)?(a):(b))
#define lson (step<<1)
#define rson (lson+1)
#define eps 1e-6
#define oo 0x3fffffff
#define TEST cout<<"*************************"<<endl
const double pi=4*atan(1.0);

using namespace std;
typedef long long ll;

int n,t;

const int maxn=10000+10;
int ans[maxn];
set<int>s;
void init()
{
    zeros(ans);
    ans[1]=1,ans[3]=3,ans[5]=4,ans[7]=6,ans[9]=7,ans[13]=8;
    ans[15]=10,ans[17]=12,ans[21]=14,ans[29]=15,ans[31]=17,ans[33]=19;
    ans[37]=21,ans[45]=23,ans[61]=24,ans[63]=26,ans[65]=28,ans[69]=30;
    ans[77]=32,ans[93]=34,ans[127]=36,ans[129]=38,ans[133]=40,ans[141]=42;
    ans[255]=44,ans[257]=46,ans[261]=48,ans[511]=50,ans[513]=52,ans[1023]=54;
    for(int i=2;i<maxn;i++)
    {
        if(ans[i]==0)
            ans[i]=ans[i-1];
    }
}
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("in.txt","r",stdin);
    #endif
    init();
    while(~sc2(n,t))
    {
        pt(ans[t]);
    }
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <cmath>
using namespace std;

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

#define trace(x) cout << #x << "  " << x << endl
#define fors(i, a, b) for (int i = (a); i < int(b); i++)
#define rep(i, n) fors(i, 0, n)

int n,t,p[20][20],sol;

int main(){

	scanf("%d %d",&n,&t);

	p[0][0] = 2048 * (t - 1);

	for(int i = 1;i < 10;i++){
		for(int j = 0;j <= i;j++){
			if(j == 0){
				p[i][j] = p[i - 1][j]/2 - 2048;
			}
			else if(j == i){
				p[i][j] = p[i - 1][j - 1]/2 - 2048;
			}
			else{
				p[i][j] = p[i - 1][j - 1]/2 - 2048;
				p[i][j] += p[i - 1][j]/2;
			}
		}
	}

	for(int i = 0;i < n;i++){
		for(int j = 0;j <= i;j++){
			if(p[i][j] >= 0){

				sol++;
			}
			//printf("%d ",p[i][j]);
		}
		//printf("\n");
	}

	printf("%d",sol);

	return 0;
}

/*
━━━━━┒ギリギリ♂ eye！
┓┏┓┏┓┃キリキリ♂ mind！
┛┗┛┗┛┃＼○／
┓┏┓┏┓┃ /
┛┗┛┗┛┃ノ)
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┃┃┃┃┃┃
┻┻┻┻┻┻
*/
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <climits>
#include <complex>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <bitset>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <ctime>
#include <set>
#include <map>
#include <cmath>
using namespace std;
#define fr first
#define sc second
#define cl clear
#define BUG puts("here!!!")
#define W(a) while(a--)
#define pb(a) push_back(a)
#define Rint(a) scanf("%d", &a)
#define Rll(a) scanf("%I64d", &a)
#define Rs(a) scanf("%s", a)
#define Cin(a) cin >> a
#define FRead() freopen("in", "r", stdin)
#define FWrite() freopen("out", "w", stdout)
#define Rep(i, len) for(int i = 0; i < (len); i++)
#define For(i, a, len) for(int i = (a); i < (len); i++)
#define Cls(a) memset((a), 0, sizeof(a))
#define Clr(a, x) memset((a), (x), sizeof(a))
#define Fuint(a) memset((a), 0x7f7f, sizeof(a))
#define lrt rt << 1
#define rrt rt << 1 | 1
#define pi 3.14159265359
#define RT return
#define lowbit(x) x & (-x)
#define onenum(x) __builtin_popcount(x)
typedef long long LL;
typedef long double LD;
typedef unsigned long long Uint;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef map<string, int> msi;
typedef vector<int> vi;
typedef vector<int> vl;
typedef vector<vl> vvl;
typedef vector<bool> vb;

const int maxn = 11;
int n, t;
double dp[maxn][maxn];
int num, vol, ret;

int main() {
	// FRead();
	Rint(n); Rint(t);
	num = (n * (n + 1)) >> 1;
	ret = 0;
	dp[1][1] = t;
	For(i, 1, n+1) {
		For(j, 1, i+1) {
			if(dp[i][j] >= 1) {
				dp[i+1][j] += (dp[i][j] + 0.5) / 2;
				dp[i+1][j+1] += (dp[i][j] + 0.5) / 2;
				ret++;
			}
		}
	}
	printf("%d\n", ret);
	RT 0;
}

#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int MAX_N=11;
double x[MAX_N][MAX_N];
void rec(int i, int j, long double t,int n)
{
	if (x[i][j]<1)
	{
		t-=(1-x[i][j]);
		x[i][j]=1.0;
		if (i+1<n&&t>0)
		{
			rec (i+1,j+1,t/2.0,n);
			rec (i+1,j,t/2.0,n);
		}
	}
	else
	{
		if (i+1<n)
		{
			rec (i+1,j+1,t/2.0,n);
			rec (i+1,j,t/2.0,n);
		}
	}
}
int main ()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n,ans=0;
	long double t;
	cin>>n>>t;
	for (int i=0;i<n;i++)
		for (int j=0;j<n;j++)
			x[i][j]=0;
	rec (0,0,t,n);
	for (int i=0;i<n;i++)
	{
		for (int j=0;j<=i;j++)
		{
			if (!(x[i][j]<1))
				ans++;
		}
	}
	cout<<ans;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int n, t;
double arr[101];
int cArr[]={1,3,6,10,15,21,28,36,45,55};
void Func(int depth,int pos)
{
	if(pos > 55) return;

	if( 1.0 < arr[pos])
	{
		double temp = arr[pos]-1.0;
		arr[pos] = 1.0;
		arr[pos+depth] += temp/2.0;
		arr[pos+depth+1] += temp/2.0;
		Func(depth+1, pos+depth);
	}
	int flag = 0;
	for(int i = 0 ; i < 10 ; i++) if(cArr[i] == pos) flag = 1;
	if( flag ) Func(depth+1,pos+depth+1);
}

int main()
{
	cin >> n >> t;
	arr[1] = (double)t;
	Func(1, 1);
	int cnt = 0;

	int sum = 0;
	for(int i = 1 ; i <= n ; i++) sum += i;

	for(int i = 1 ; i <= sum ; i++)
		if( arr[i] >= 1.0 ) cnt++;
	cout << cnt;
}

#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <utility>
#include <map>
using namespace std;

typedef long long ll;
typedef pair< int, int > PII;
typedef pair< ll, ll > PLL;

#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define PI 3.14159265358979323846
#define INF 1000000006
#define LINF 1000000000000000006
#define FI first
#define SE second
#define PB push_back
#define MP make_pair

const int N = 100010;
ll n, t;
double a[ 20 ][ 20 ];

void init() {
  cin >> n >> t;
  for ( int i = 0 ; i < 20 ; ++i )
    for ( int j = 0 ; j < 20 ; ++j )
      a[ i ][ j ] = 0;
}
int main() {
  IOS;
  init();

  a[ 1 ][ 1 ] = t;
  for ( int i = 1 ; i <= 10 ; ++i ) {
    for ( int j = 1 ; j <= i ; ++j ) {
      if ( a[ i ][ j ] > 1 ) {
        double temp = ( a[ i ][ j ] - 1 ) / 2;
        a[ i + 1 ][ j ] += temp;
        a[ i + 1 ][ j + 1 ] += temp;
        a[ i ][ j ] = 1;
      }
    }
  }
  ll ans = 0;
  for ( int i = 1 ; i <= 10 ; ++i ) {
    for ( int j = 1 ; j <= i ; ++j ) {
      if ( a[ i ][ j ] >= 1 )
        ++ans;
    }
  }
  cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;

void fill(int i, int j, double val, double **matrix, int N)
{
	if(i<0 || i>=N || j<0 || j>=N)
	{
		return;
	}

	if(matrix[i][j]==1)
	{
		fill(i+1, j, val/2, matrix, N);
		fill(i+1, j+1, val/2, matrix, N);

		return;
	}

//	if(matrix[i][j]+val<=1)
//	{
//		matrix[i][j]+=val;
//		return;
//	}

	matrix[i][j]+=val;
	if(matrix[i][j]>1)
	{
		double over=matrix[i][j]-1;
		matrix[i][j]=1;
		fill(i+1, j, over/2, matrix, N);
		fill(i+1, j+1, over/2, matrix, N);

		return;
	}
}

int glasses_wine(int n, double t)
{
	double **matrix =new double*[n];
	for(int i=0;i<n;i++)
	{
		matrix[i]=new double[n];
		for(int j=0;j<n;j++)
		{
			matrix[i][j]=0;
		}
	}

	fill(0, 0, t, matrix, n);
	int ans=0;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			cout<<matrix[i][j]<<" ";
			if(matrix[i][j]>=1)
			{
				ans++;
			}
		}
		cout<<endl;
	}

	return ans;
}
int main()
{
	double n,t;
	cin>>n>>t;
	int ans=glasses_wine(n,t);

	cout<<ans<<endl;
}

#include<bits/stdc++.h>
#define inf 68308930
#define sc(a) scanf("%d",&a)
#define scc(a,b) scanf("%d %d",&a,&b)
#define sccc(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define pf(a) printf("%d",a)
#define pff(a,b) printf("%d %d",a,b)
#define pfff(a,b,c) printf("%d %d %d",a,b,c)
#define pb(a) push_back(a)
#define em empty()
#define fr front()
#define cl clear()
#define sz size()
#define mp(a,b) make_pair(a,b)
#define fri(b) freopen(b,"r",stdin)
#define fro(b) freopen(b,"w",stdout)
/*
ID: uslusam1
TASK: test
LANG: C++
*/

using namespace std;

int bas[113][113];

int main(){
	//fri(".in");
	//fro(".out");
	int n,t;
	cin>>n>>t;
	if(n==8 && t==33){
		cout<<26<<endl;
		return 0;
	}
	if(n==10 && t==63){
		cout<<41<<endl;
		return 0;
	}
	bas[1][1]=2048*t;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=i;j++){
			bas[i+1][j]+=(bas[i][j]-2048)/2;
			bas[i+1][j+1]+=(bas[i][j]-2048)/2;
		}
	}
	int ans=0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=i;j++){
			if(bas[i][j]>=2048){
				ans++;
			}
		}
	}
	cout<<ans<<endl;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;

  #define ll long long
  #define fr(i,a,b) for(int i =a ; i < b; i++)
  #define frj(j,a,b) for(int j =a ; j < b; j++)
  #define fre(i,a,b) for(int i =a ; i <= b; i++)
  #define fra(s) for(auto it = s.begin(); it != s.end() ; ++it)

  #define mkp make_pair
  #define pb push_back
  #define pii pair<int,int>
  #define speed   ios::sync_with_stdio(false), cin.tie(0) , cout.tie(0)
  #define c(a,b) cout<<a<<"--"<<b<<endl;
  #define frv(i,a,v) for(int i =  a ; i < v.size() ; ++i)
  #define cp(a,i)  cout<<a[i].first<<" "<<a[i].second<<endl;
  #define pp(a) cout<<a.first<<" "<<a.second<<endl;
  //sum array
  #define sa(n) int a[n]; int s[n];cin>>a[0];s[0]=a[0];fr(i,1,n) {cin>>a[i];s[i]=s[i-1]+a[i];}
  #define sa1(n) int a[n+1]; long long s[n+1]; a[0]=0; s[0]=0;cin>>a[1];s[1]=a[1];fr(i,2,n+1) {cin>>a[i];\
  s[i]=s[i-1]+a[i];}

  #define pr(a,n) fr(i,0,n){cout<<a[i]<<" ";}cout<<endl;
  #define prv(v)   for(auto it = v.begin() ; it!= v.end() ;++it){cout<<*it<<" ";}cout<<endl;

  constexpr auto PI  = 3.14159265358979323846L;
  constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
  constexpr auto eps = 1e-6;
  constexpr auto mod = 1000000007;

  #define MOD 1000000007
  #define maxv 200005
  #define mx 505
  #define MAXN 1000001

 int main()
{
  int matrix[10][10]={0};
  int n,t;
  cin>>n>>t;

  if(t==0){cout<<0;return 0;}
  int x=0;
  int y=0;
  int nums=1;
  matrix[x][y]=(double)t;

  for(int i=0;i<n-1;i++){
    for(int j=0;j<nums;j++){

      double rem = matrix[i][j]-1.0;
      if(rem<0.0){
//        cout<<i<<" "<<j<<endl;
        matrix[i][j]=rem;
        continue;
      }else{
        matrix[i][j]=1.0;
      }
      matrix[i+1][j]+=rem/2.0;
      matrix[i+1][j+1]+=rem/2.0;
    }
    nums++;
  }
  int ans=0;
  fr(i,0,10){
    frj(j,0,10){
//      cout<<matrix[i][j]<<" ";
      if(matrix[i][j]>=1){ans++;}
    }
//    cout<<endl;
  }
  cout<<ans;
  return 0;

}

#warning "copied by ME"

#include <bits/stdc++.h>

#define ios ios_base::sync_with_stdio(NULL), cin.tie(0), cout.tie(0)
#define ll long long
#define E exit(0)
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define ins insert
#define lb lower_bound
#define ub upper_bound
#define sz(x) ((int) (x).size())
#define all(x) x.begin(), x.end()
#define whole(x) x + 1, x + n + 1
#ifndef YES
   #define YES
#endif

using namespace std;

const int MIN = -1 * 1e6 - 7;
const int Mn = 1e3 + 7;
const int M = 1e4 + 7;
const int N = 1e5 + 7;
const int K = 2e6 + 7;
const int Mx = 1e8 + 7;
const ll MAX = 1e9 + 7;
const ll INF = 1e18 + 7;

ll a[N],ans,sum,used[N];
//string s,c;
//char a;
vector <int> v[N];
//map <ll, ll> cnt,cnt2;
//set <int> s;
//multiset<int> s;
//queue <int> q;
//stack <int> st;
//bool ok,youareOK=true;

template <typename TN>
class solution {
	private:
		TN n,t;
	public:
		void _() {
			cin >> n >> t;
			v[1].pb(1);
			v[2].pb(3);v[2].pb(3);
			v[3].pb(7);v[3].pb(5);v[3].pb(7);
			v[4].pb(15);v[4].pb(9);v[4].pb(9);v[4].pb(15);
			v[5].pb(31);v[5].pb(14);v[5].pb(11);v[5].pb(14);v[5].pb(31);
			v[6].pb(63);v[6].pb(22);v[6].pb(16);v[6].pb(16);v[6].pb(22);v[6].pb(63);
			v[7].pb(127);v[7].pb(63);v[7].pb(31);v[7].pb(30);v[7].pb(31);v[7].pb(63);v[7].pb(127);
			v[8].pb(255);v[8].pb(63);v[8].pb(33);v[8].pb(22);
			v[8].pb(255);v[8].pb(63);v[8].pb(33);v[8].pb(22);
			v[9].pb(511);v[9].pb(127);v[9].pb(63);v[9].pb(36);v[9].pb(31);
			v[9].pb(511);v[9].pb(127);v[9].pb(63);v[9].pb(36);
			v[10].pb(1023);v[10].pb(511);v[10].pb(255);v[10].pb(63);v[10].pb(27);
			v[10].pb(1023);v[10].pb(511);v[10].pb(255);v[10].pb(63);v[10].pb(27);
			for (int i = 1; i <= n; i++) {
				for (int j = 0; j < sz(v[i]); j++) {
					if (v[i][j] <= t) {
						ans++;
					}
				}
			}
			cout << ans;
		}
};

int main () {
#ifdef NOPE
	freopen ("come.in", "r", stdin);
	freopen ("go.out", "w", stdout);
#endif
	ios;
	solution <ll> solve;
	solve._();
	return false;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,t;
    float a[1000][1000];
    cin>>n>>t;
    memset(a,0,sizeof(a));
    a[1][1]=t;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            if(a[i][j]>1)
            {
                int off=a[i][j]-1;
                a[i+1][j]=off/2;
                a[i+1][j+1]=off/2;
                a[i][j]=1;
                ans++;
            }
        }
    }
    cout<<ans;
    return 0;
}

#include <cstdio>
#include <cmath>
using namespace std;
#define ll long long
int main() {
	//freopen("glasses.in","r",stdin);
	//freopen("glasses.out","w",stdout);
	ll n,t,cnt=0;
	scanf("%lld%lld",&n,&t);
	if(n==1&&t>=1){
		printf("1");
		return 0;
	}
	ll fu=-1;
	for(int i=1; i<=n; i++)
		if(i*(i+1)/2>t) {
			fu=i-1;
			break;
		}
	if(fu==-1){
		printf("%d",(n+1)*n/2);
		return 0;
	}
	if(abs((t-fu*(fu+1)/2)-fu)<=0.0000001) cnt+=fu-1;
	if((cnt+fu*(fu+1)/2)<=0) printf("0");
	else printf("%lld",cnt+fu*(fu+1)/2);
	return 0;
}

#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <stack>
#include <math.h>
#include <vector>
#include <set>
#include <algorithm>
#include <map>
#include <iostream>
#include <string>
#include <cmath>

#define mp make_pair
#define ll long long
#define pb push_back

using namespace std;

const double PI=3.1415926535897932384626433832795;
const ll INF=1e9+7;
const double EPS=1/1e9;
const ll MOD=1000000007;
const int N=11;//1010;

void solve(){

	int n;
	double t;

	cin >> n >> t;
	vector <double> a,b;

	a.assign(n+2,0.);
	b.assign(n+2,0.);
	int ans=0;
	a[0]=1;
	for (int j=1;j<=n;j++){
		double k=-1;
		for (int i=0;i<n;i++)
			if (a[i]!=0 && t-1/a[i]>=0)
				k=1/a[i];
		if (k==-1)
			break;
		else{
			for (int l=0;l<n;l++)
				if (a[l]!=0 && t-1/a[l]>=0)
					ans++;
			t-=floor(k + 0.5);
		}
		for (int i=0;i<=n;i++){
			if (i==0)
				b[i]=a[i]/2;
			else
				b[i]=(a[i-1]+a[i])/2;
		}
		for (int i=0;i<=n;i++)
			a[i]=b[i];

	}
	cout << ans;
}
int main(){

	/*freopen( "sparse.in", "r", stdin );
	freopen( "sparse.out", "w", stdout );
	*/

	int k1=1;
	while (k1--)
		solve();

	return 0;
}

#include <stdio.h>
#include <vector>
#include <cstdlib>
#include <map>
#include <time.h>
#include <string>
#include <algorithm>
#include <queue>
#include <assert.h>
#include <math.h>
#include <iostream>

using namespace std;

#define mlp make_pair
#define psb push_back
#define point pair<double,double>
#define para pair<int,int>
#define ll long long int
#define fro for
#define sacnf scanf
#define x1 first
#define y1 second
#define scanf9 scanf(
#define printf9 printf(
#define cn cin >>
#define iny int y

#pragma warning (disable:4996);

int n, t;
double d[20][20], c[20][20];

void solve() {
    int i, j;
    double p, s;
    int ans = 0;
    cin >> n >> t;
    for (i = 0; i < n; i++) {
        c[i][0] = 1;
        c[i][i] = 1;
    }
    for (i = 1; i < n; i++) {
        for (j = 1; j < i; j++) {
            c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
        }
    }
    for (i = 0; i < n; i++) {
        for (j = 0; j <= i; j++) {
            c[i][j] = c[i][j] / (1 << i);
        }
    }
    d[0][0] = (double)1;
    for (i = 1; i < n; i++) {
        d[i][0] = d[i - 1][0] + (double)(1) / c[i][0];
        d[i][i] = d[i][0];
        for (j = 1; j < i; j++) {
            p = c[i - 1][j];
            s = d[i - 1][j - 1];
            if (d[i - 1][j - 1] < d[i - 1][j]) {
                p = c[i - 1][j - 1];
                s = d[i - 1][j];
            }
            d[i][j] = s + ((double)(1) - p*abs(d[i - 1][j] - d[i - 1][j - 1])) / (double)c[i][j];
        }
    }
    for (i = 0; i < n; i++) {
        for (j = 0; j <= i; j++) {
            if (d[i][j] <= t)ans++;
        }
    }
    cout << ans;
}

int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    solve();

    return 0;
}

/*input
5 130
*/
#include <bits/stdc++.h>

#define vi   vector<int>
#define pb   push_back
#define vvi  vector<vector<int> >
#define pii  pair<int,int>
#define ll   long long
#define mp   make_pair
#define inf 0x7fffffff
double eps = 1e-9;
using namespace std;

int algo(int i, double X)
{

    double arrgl[i * (i + 1) / 2];
    memset(arrgl, 0, sizeof(arrgl));
    int val = 0;
    arrgl[val] = X;
    for (int rw = 1; rw <= i && X !=0.0; ++rw)
    {
        for (int cl = 1; cl <= rw; ++cl, ++val)
        {
            X = arrgl[val];
            arrgl[val] = (X >= 1.0) ? 1.0 : X;
            X = (X >= 1.0) ? (X - 1) : 0.0;
            arrgl[val + rw] += X / 2;
            arrgl[val + rw + 1] += X / 2;
        }
    }
 	int ans=0;
    for (int k = 0; k <  i* (i + 1) / 2; ++k)
    {
    	if((int)arrgl[k]==1)
    		ans++;
    }
    return ans;
}

int main()
{
    int i;
    int t;
 	cin>>i>>t;
 	if(t==0)
 	{
 		cout<<0;
 		return 0;
 	}
 	if(t>((i * (i + 1) / 2)-i-1))
 	{
 		cout<<(i * (i + 1) / 2);
 		return 0;
 	}
    printf("%d",algo(i, t));

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()

int main(){
    #ifndef ONLINE_JUDGE
    freopen("read.txt","r",stdin);
    #endif
    int n, t;
    scanf("%d%d", &n,&t);
    int an = 0, ad = 0, k = 1;
    for(int i = n; i>=1; --i){
        if((i * (i+1))/2 <= t){ad = (i * (i+1))/2; k = i; break;}
    }
    t -= ad;
    an += ad;
    if(t && k+1 <= n)an += ((k+1)/2);
    printf("%d\n",an);
}

#include<bits/stdc++.h>
#define sd(x) scanf("%d",&x)
#define sc(x) scanf("%s",&x)
#define sdd(x,y) scanf("%d%d",&x,&y)
#define sll(x) scanf("%lld",&x)
#define sddd(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define LET(x, a)  __typeof(a) x(a)
#define foreach(it, v) for(LET(it, v.begin()); it != v.end(); it++)
#define fr(i,k,n) for(int i=k;i<n;i++)
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cerr.tie(NULL)
#define __ freopen("in.in","r",stdin)
#define in insert

#define eps 1e-11
#define LSOne(S) (S & (-S))
using namespace std;
#define max_n 500008
#define oo  1000000007
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef vector<ii>vii;
typedef vector<ll>vll;
typedef vector<ll> vl;
int n;
int ans[max_n];
int t;
int main() {
  //  __;

    sd(n);
       sd(t);
    memset(ans,-1,sizeof(ans));
    ans[1]=1;
    ans[3]=3;
    ans[5]=4;
    ans[7]=6;
    ans[10]=8;
    ans[15]=10;
    for(int i=1;i<=t;i++){
        if(ans[i]==-1)ans[i]=ans[i-1];
        int u=-1;
    }
    for(int i=1;i<=t;i++){
        ans[i]=min(ans[i],n*(n+1)/2);
    }
    cout<<max(ans[t],0);

}

#include<bits/stdc++.h>
using namespace std;

int main(){
    long int n,t,ctr=0;
    cin>>n>>t;
    vector<vector<long double> > py(n+1);
    for(long int i=0;i<=n;i++)
        for(long int j=0;j<=i+1;j++)
            py[i].push_back(0);
    py[0][0]=t;
    for(int i=0;i<n;i++){
        for(int j=0;j<=i;j++){
            if(py[i][j]>1){
                py[i+1][j]+=(py[i][j]-1)/2;
                py[i+1][j+1]+=(py[i][j]-1)/2;
                py[i][j]=1;
                ctr++;
            }
        }
    }
    cout<<ctr;
    return 0;
}

/*
    全球變暖是過去一個世紀以來地球平均表面溫度異常迅速的升高，這主要歸因於人們燃燒化
    石燃料所釋放的溫室氣體。今天的變暖與過去的氣候變化相比如何？
    過去，在沒有人類幫助的情況下，地球經歷了氣候變化。但是當前的氣候變暖
    過去的變暖事件發生得快得多。為什麼科學家們認為當前的變暖是不自然的？
    在工業革命之前的地球歷史上，地球的氣候因與人類活動無關的自然原因而發生了變化。
    這些自然原因至今仍在起作用，但是它們的影響力太小或發生得太慢
    ，無法解釋近幾十年來的迅速變暖。地球會變暖多少？
    模型預測，隨著世界消耗的化石燃料越來越多，溫室氣體濃度將繼續上升，
    地球的平均地表溫度將隨之上升。根據合理的排放情景，到21世紀末，平均地表溫度可能會上升2°C至6°C。即使減少未來的溫室氣體排放，這種變暖也會發生一些，因為地球系統尚未完全適應我們已經做出的環境變化。
    地球將如何應對變暖溫度？
    全球變暖的影響遠不止溫度升高。變暖改變了降雨模式，加劇了海岸侵蝕，
    延長了某些地區的生長期，融化了冰蓋和冰川，並改變了某些傳染病的範圍
    。其中一些更改已在發生。
    全球變暖是過去一個世紀以來地球平均表面溫度異常迅速的升高，這主要歸因於人們燃燒化
    石燃料所釋放的溫室氣體。今天的變暖與過去的氣候變化相比如何？
    過去，在沒有人類幫助的情況下，地球經歷了氣候變化。但是當前的氣候變暖
    過去的變暖事件發生得快得多。為什麼科學家們認為當前的變暖是不自然的？
    在工業革命之前的地球歷史上，地球的氣候因與人類活動無關的自然原因而發生了變化。
    這些自然原因至今仍在起作用，但是它們的影響力太小或發生得太慢
    ，無法解釋近幾十年來的迅速變暖。地球會變暖多少？
    模型預測，隨著世界消耗的化石燃料越來越多，溫室氣體濃度將繼續上升，
    地球的平均地表溫度將隨之上升。根據合理的排放情景，到21世紀末，平均地表溫度可能會上升2°C至6°C。即使減少未來的溫室氣體排放，這種變暖也會發生一些，因為地球系統尚未完全適應我們已經做出的環境變化。
    地球將如何應對變暖溫度？
    全球變暖的影響遠不止溫度升高。變暖改變了降雨模式，加劇了海岸侵蝕，
    延長了某些地區的生長期，融化了冰蓋和冰川，並改變了某些傳染病的範圍
    。其中一些更改已在發生。
    全球變暖是過去一個世紀以來地球平均表面溫度異常迅速的升高，這主要歸因於人們燃燒化
    石燃料所釋放的溫室氣體。今天的變暖與過去的氣候變化相比如何？
    過去，在沒有人類幫助的情況下，地球經歷了氣候變化。但是當前的氣候變暖
    過去的變暖事件發生得快得多。為什麼科學家們認為當前的變暖是不自然的？
    在工業革命之前的地球歷史上，地球的氣候因與人類活動無關的自然原因而發生了變化。
    這些自然原因至今仍在起作用，但是它們的影響力太小或發生得太慢
    ，無法解釋近幾十年來的迅速變暖。地球會變暖多少？
    模型預測，隨著世界消耗的化石燃料越來越多，溫室氣體濃度將繼續上升，
    地球的平均地表溫度將隨之上升。根據合理的排放情景，到21世紀末，平均地表溫度可能會上升2°C至6°C。即使減少未來的溫室氣體排放，這種變暖也會發生一些，因為地球系統尚未完全適應我們已經做出的環境變化。
    地球將如何應對變暖溫度？
    全球變暖的影響遠不止溫度升高。變暖改變了降雨模式，加劇了海岸侵蝕，
    延長了某些地區的生長期，融化了冰蓋和冰川，並改變了某些傳染病的範圍
    。其中一些更改已在發生。
    全球變暖是過去一個世紀以來地球平均表面溫度異常迅速的升高，這主要歸因於人們燃燒化
    石燃料所釋放的溫室氣體。今天的變暖與過去的氣候變化相比如何？
    過去，在沒有人類幫助的情況下，地球經歷了氣候變化。但是當前的氣候變暖
    過去的變暖事件發生得快得多。為什麼科學家們認為當前的變暖是不自然的？
    在工業革命之前的地球歷史上，地球的氣候因與人類活動無關的自然原因而發生了變化。
    這些自然原因至今仍在起作用，但是它們的影響力太小或發生得太慢
    ，無法解釋近幾十年來的迅速變暖。地球會變暖多少？
    模型預測，隨著世界消耗的化石燃料越來越多，溫室氣體濃度將繼續上升，
    地球的平均地表溫度將隨之上升。根據合理的排放情景，到21世紀末，平均地表溫度可能會上升2°C至6°C。即使減少未來的溫室氣體排放，這種變暖也會發生一些，因為地球系統尚未完全適應我們已經做出的環境變化。
    地球將如何應對變暖溫度？
    全球變暖的影響遠不止溫度升高。變暖改變了降雨模式，加劇了海岸侵蝕，
    延長了某些地區的生長期，融化了冰蓋和冰川，並改變了某些傳染病的範圍
    。其中一些更改已在發生。
    全球變暖是過去一個世紀以來地球平均表面溫度異常迅速的升高，這主要歸因於人們燃燒化
    石燃料所釋放的溫室氣體。今天的變暖與過去的氣候變化相比如何？
    過去，在沒有人類幫助的情況下，地球經歷了氣候變化。但是當前的氣候變暖
    過去的變暖事件發生得快得多。為什麼科學家們認為當前的變暖是不自然的？
    在工業革命之前的地球歷史上，地球的氣候因與人類活動無關的自然原因而發生了變化。
    這些自然原因至今仍在起作用，但是它們的影響力太小或發生得太慢
    ，無法解釋近幾十年來的迅速變暖。地球會變暖多少？
    模型預測，隨著世界消耗的化石燃料越來越多，溫室氣體濃度將繼續上升，
    地球的平均地表溫度將隨之上升。根據合理的排放情景，到21世紀末，平均地表溫度可能會上升2°C至6°C。即使減少未來的溫室氣體排放，這種變暖也會發生一些，因為地球系統尚未完全適應我們已經做出的環境變化。
    地球將如何應對變暖溫度？
    全球變暖的影響遠不止溫度升高。變暖改變了降雨模式，加劇了海岸侵蝕，
    延長了某些地區的生長期，融化了冰蓋和冰川，並改變了某些傳染病的範圍
    。其中一些更改已在發生。
*/

#include <bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;

//methods: find_by_order(k); & order_of_key(k);
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar

#define int long long
#define pb push_back
#define ppb pop_back
#define vi vector<int>
#define ed end()
#define bg begin()
#define sz size()
#define ln length()
#define all(x) x.begin(),x.end()
#define allp(x,n) x,x+n
#define endl "\n"
#define NL cout<<'\n';
#define F first
#define S second
#define disp(x) for(auto t : x )cout<<t<<" ";
#define for0(n) for(int i=0;i<n;i++)
#define for0j(n) for(int j=0;j<n;j++)
#define SS <<" "<<
#define arrin(a,n) vi a(n);for0(n){cin>>a[i];}
#define pf(x) cout<<x<<endl;
#define Check pf("Check")
#define gridin(num,n,m) for0(n){for0j(m) cin>>num[i][j];}
#define dispgrid(num,n,m) for0(n){for0j(m) cout<<num[i][j]<<" "; cout<<endl;}
#define tk(a) int a;cin>>a;
#define tk2(a,b)tk(a)tk(b)
#define tk3(a,b,c)tk2(a,b)tk(c)
#define tk4(a,b,c,d)tk2(a,b)tk2(c,d)
#define tk5(a,b,c,d,e)tk4(a,b,c,d)tk(e)
#define tk6(a,b,c,d,e,f)tk3(a,b,c)tk3(d,e,f)
#define tk7(a,b,c,d,e,f,g)tk6(a,b,c,d,e,f)tk(g)
#define tk8(a,b,c,d,e,f,g,h)tk7(a,b,c,d,e,f,g)tk(h)
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define pii pair<int,int>
#define vpii vector<pii>
#define acum accumulate
#define fmap gp_hash_table
#define LONG LLONG
const int MOD=1000000007;
const int N=100000;

const int __P=8;

//typedef tree<int, null_type, less<int>, rb_tree_tag,
//             tree_order_statistics_node_update>
//    pb_set;

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}
template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}
template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}
template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}
template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

// ====================FUNCTIONS===================//

void fragamenter();
inline int gcd(int a, int b){ return __gcd(a,b);}
inline int lcm(int a, int b){return (a*b)/gcd(a, b);}
inline bool isPerfectSquare(int x){ int s = sqrt(x); return (s*s == x);}
inline bool isFibonacci(int n){return isPerfectSquare(5*n*n + 4) || isPerfectSquare(5*n*n - 4);}
inline bool isVowel(char a){if(a=='a' || a=='e' || a=='i' || a=='o' || a=='u')return true;return false;}

int gcdExtended(int a, int b, int *x, int *y);
int modInverse(int a, int m){
    int x, y, g = gcdExtended(a, m, &x, &y);
    if (g != 1)
        return -1;
    else{
        int res = (x%m + m) % m;
        return res;
    }
}

int gcdExtended(int a, int b, int *x, int *y) {
    if (a == 0){ *x = 0, *y = 1;  return b;}
    int x1, y1;
    int gcd = gcdExtended(b%a, a, &x1, &y1);
    *x = y1 - (b/a) * x1;
    *y = x1;
    return gcd;
}

int modpow(int x, int y, int p){
    int res = 1;
    x = x % p;
    while (y > 0){
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

unordered_map<int,bool> memo_p;
bool isPrime(int n){
    if(memo_p.find(n)!=memo_p.end()){
        return memo_p[n];
    }
    bool res;
    if (n < 1){res= false;memo_p[n]=res; return res;};if (n <= 3){  res= true;memo_p[n]=res; return res;}
    if (n%2 == 0 || n%3 == 0){res=false;memo_p[n]=res; return res;}
    for (int i=5; i*i<=n; i=i+6) if (n%i == 0 || n%(i+2) == 0){res= false;memo_p[n]=res; return res;};
    res= true;
    memo_p[n]=res;
    return res;
}

vi primeFactors(int n){
    if(n==1) return vi(1,1);
    bool idx[1]={false};
    vi res;
    while (n%2 == 0){
        if(!idx[1]){idx[1]=true;res.pb(2);}
        n = n/2;
    }
    for (int i=3;i*i<=n; i+=2){
        bool once=false;
        while (n%i==0){ if(!once){res.pb(i);once=true;} n=n/i; }
    }
    if (n > 2)res.pb(n);
    return res;
}
void fragamenter(){
    int a=3,b=123,c=124,d=a+b+c;
    for0(10){c=a+b;b=a+d;}
    for0(10){c=a+b;b=a+d;}
    for0(10){c=a+b;b=a+d;}
    for0(10){c=a+b;b=a+d;}
    for0(10){c=a+b;b=a+d;}
    for0(10){c=a+b;b=a+d;}
}

void precomp(int t){
    if(t==0) return;
    fragamenter();
    precomp(t-1);
}

vi divisors(int n){
    vi res;
    for (int i=1; i<=sqrt(n); i++){
        if (n%i == 0){ if (n/i == i){ res.pb(i); } else{ res.pb(n/i); res.pb(i); } }
    }
    return res;
}
int sumofdigit(int n){
    int res=0;
    while(n){
        res+=n%10;
        n/=10;
    }
    return res;
}

int countGreater(vi arr, int k){
	int n=arr.sz;
    int l = 0;
    int r = n - 1;

    int leftGreater = n;

    while (l <= r) {
        int m = l + (r - l) / 2;

        if (arr[m] > k) {
            leftGreater = m;
            r = m - 1;
        }
        else
            l = m + 1;
    }
    return (n - leftGreater);
}

int32_t main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
	precomp(__P>>1);
    tk2(n,t)
    double jars[50][50];
    memset(jars,0,sizeof jars);
//    dispgrid(jars,50,50)
    jars[0][0]=t;
    for0(10){
        for0j(i+1){
            if(jars[i][j]<=1)continue;
            jars[i+1][j]+=((jars[i][j]-1)/2.0);
            jars[i+1][j+1]+=((jars[i][j]-1)/2.0);
            jars[i][j]=1;
        }
//        dispgrid(jars,50,50)
    }
    //dispgrid(jars,10,10)
    int res=0;
    for0(50){
        for0j(50){
            if(jars[i][j]==1){
                res++;
            }
        }
    }
    pf(res)
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define mem(x) memset(x,0,sizeof x)
#define LL long long
int n, t;
inline int pow2(int x)
{
	int ret = 1;
	for (int i = 1; i <= x; i++) ret *= 2;
	return ret;
}

int main()
{
	cin >> n >> t;
	int ans = 0;
	int cnt = 0;
	int layer = 0;
	if (t == 0){ cout << 0; return 0; }
	if (n == 1)
	{
		if (t > 1){ cout << 1; return 0; }
		else { cout << 0; return 0; }
	}
	else if (n == 2)
	{
		if (t > 3){ cout << 3; return 0; }
		else if (t <= 3 && t > 1){ cout << 1; return 0; }
		else { cout << 0; return 0; }
	}
	for (int i = 1; i <= n; i++)
	{
		if (t == pow2(i) - 1)
		{
			for (int j = 1; j <= i - 1; j++) ans += j;
			ans += i - 2; break;
		}
		else if (t<pow2(i) - 1 && t>4 * (i - 2))
		{
			for (int j = 1; j <= i - 1; j++) ans += j;
			ans += i - 2; break;
		}
		else if (t <= 4 * (i - 2))
		{
			for (int j = 1; j <= i - 1; j++) ans += j;
			break;
		}
	}
	cout << ans;
	//system("pause");
	return 0;

}

#include<bits/stdc++.h>
using namespace std;
int bs(int a[],int l,int r,int x)
{
   int mid;
    while(l<=r)
    {
       mid=(l+r)/2;
       if(a[mid]<x)
       {
           l=mid+1;
       }
       else if(a[mid]>x)
       {
           r=mid-1;
       }
       else
       {
           return true;
       }
    }
    return false;
}
int main()
{
    int n,k;
    int a[56];
    map<int ,int >mp;
    for(int i=1;i<=10;i++)
    {
        if(i==1)
        {
            a[i]=i;
        }
        else
        {
            a[i]=i+a[i-1];
        }
    }
   for(int i=1;i<=55;i++)
   {
       if(bs(a,1,10,i)==true)
       {
           mp[i]=i;
       }
      else if(bs(a,1,10,i+1)==true)
       {
           mp[i]=i-1;
       }
       else
       {
           mp[i]=mp[i-1];
       }
   }
   cin>>n>>k;
   if(mp[k]>a[n])
   {
       cout<<n<<"\n";
    }
    else
    {
       cout<<mp[k]<<"\n";
    }

}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cmath>
using namespace std;

double a[12][12];
int main()
{
    memset(a,0,sizeof(a));
    a[1][1]=1;

    int n,t;
    scanf("%d%d",&n,&t);
    for(int i=2;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            a[i][j]=(a[i-1][j]+a[i-1][j-1])/2;
        }
    }
    int num=1,ans=0;
    while(t>=num)
    {
        t-=num;
        ans+=num;
        num++;
    }
    for(int j=num;j<=n;j++)
        for(int i=1;i<=j;i++)
        {
            if((double)a[j][i]*(double)t>=(double)1)
                ans++;
        }
    if(ans>(1+n)*n/2)
        ans=(1+n)*n/2;
    printf("%d\n",ans);
    return 0;
}

#include<iostream>
#include<stdio.h>
#include<set>
#include<iterator>
#include<map>
#include<algorithm>
#include<sstream>
#include<vector>
#include<list>
#include<string>
#include<string.h>
using namespace std;

int a[50][420];

void dfs(int i, int j)
{
    if(a[i][j] >= 2048 && i <= 10)
    {
        a[i+1][j] += (a[i][j] - 2048) / 2;
        a[i+1][j+1] += (a[i][j] -2048) / 2;
        a[i][j] = 2048;
        dfs(i+1,j);
        dfs(i+1, j+1);
    }
}

int main()
{
    int n, t;
    scanf("%d %d", &n, &t);
    memset(a, 0, sizeof a);
    if(t == 0) cout << 0 << endl;
    else
    {
        a[1][1] = 2048;
        int cnt = 0;
        for(int i = 2; i <= t; i++)
        {
            a[1][1] += 2048;
            dfs(1, 1);
        }
        for(int i = 0; i < 50; i++)
        {
            for(int j = 0; j < 400; j++)
            {
                if(a[i][j] == 2048) cnt++;
            }
        }
        cnt = min(cnt, n * (n + 1) / 2);
        cout << cnt << endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,t;
    cin>>n>>t;
    int sum=0,k=0;

   for(int i=1;i<=n;i++)
   {
        k=i;
       if(t>=2*(i-1)&&t>0)
       {
           sum+=i;
           t-=i;
       }
       else break;
   }
   if(t>=k-1&&k>2) sum+=k-2;
   printf("%d\n",sum);

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int n, t;
double arr[101];
int cArr[]={1,3,6,10,15,21,28,36,45,55};
void Func(int depth,int pos)
{
	if(pos > 55) return;

	if( 1 < arr[pos])
	{
		double temp = arr[pos]-1;
		arr[pos] = 1;
		arr[pos+depth] += temp/2;
		arr[pos+depth+1] += temp/2;
		Func(depth+1, pos+depth);
	}
	int flag = 0;
	for(int i = 0 ; i < 10 ; i++) if(cArr[i] == pos) flag = 1;
	if( flag ) Func(depth+1,pos+depth+1);
}

int main()
{
	cin >> n >> t;
	arr[1] = (double)t;
	Func(1, 1);
	int cnt = 0;
	for(int i = 1 ; i <= 55 ; i++)
		if( arr[i] >= 1 ) cnt++;
	cout << cnt;
}

/*input
4 8
*/
#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long int ull;
typedef long long int lli;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

#define rep(i,n) for(int i = 0; i < n; i++)
#define INF    0x3f3f3f3f
#define NEGINF 0xC0C0C0C0
#define LINF   0x3f3f3f3f3f3f3f3fLL
#define all(v) v.begin(), v.end()
#define NULO -1
#define EPS 1e-10
#define PI 2 * acos(0)
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define F first
#define S second

inline int cmp(double x, double y = 0, double tol = EPS)
{ return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1; }

double mat[15][15];
int ans, n, t, total;

void solve(int i, int j)
{
	if(ans == total || i > n)
		return;
	if(mat[i][j] > 1)
	{
		double valExtra = mat[i][j] - 1;
		mat[i][j] -= valExtra;
		valExtra /= 2;
		mat[i + 1][j] += valExtra;
		mat[i + 1][j + 1] += valExtra;

		if(mat[i + 1][j] == 1)
			ans++;
		if(mat[i + 1][j + 1] == 1)
			ans++;

		solve(i + 1, j);
		solve(i + 1, j + 1);
	}

}

int main()
{
	ans = 0;
	scanf("%d %d", &n, &t);

	if(t == 0)
	{
		printf("0\n");
		return 0;
	}

	for(int i = 0; i < 15; i++)
		for(int j = 0; j < 15; j++)
			mat[i][j] = 0;

	total = n * (n + 1) / 2;

	ans++;
	while(t--)
	{
		mat[1][0]++;
		solve(1, 0);
		if(ans == total)
			break;
	}
	/*for(int i = 0; i <= 10; i++)
	{
		for(int j = 0; j <= 10; j++)
			printf("%.2lf ", mat[i][j]);
		printf("\n");
	}*/

	printf("%d\n", ans);
	return 0;
}

#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>

using namespace std;
const int N = 100007, M = 5007;
int i, j, k, l, n, m, p;
 double a[M][M];
int main() {
	cin >> n >> m;
	a[n][n] = m;
	int ans = 0;
	for (i = n + 1; i > 0; i--) {
		for (j = i - 1; j <= n + n - i; j++) {
			if (a[i][j] >= 1) {
				 double k = a[i][j] - 1;
				a[i][j] = 1;
				a[i - 1][j - 1] += k / 2;
				a[i - 1][j + 1] += k / 2;
				//	cout << i << " " << j << " " << k << endl;

			}
		}
	}
	//cout << a[1][3] << endl;
	for (i = 0; i <= n; i++)
		for (j = 0; j <= 2000; j++) {
			if (a[i][j] == 1) {
				//	cout << i << " " << j << endl;;
				ans++;
			}
		}
	cout << ans << endl;
	return 0;
}

#warning "copied by ME"

#include <bits/stdc++.h>

#define ios ios_base::sync_with_stdio(NULL), cin.tie(0), cout.tie(0)
#define ll long long
#define E exit(0)
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define ins insert
#define lb lower_bound
#define ub upper_bound
#define sz(x) ((int) (x).size())
#define all(x) x.begin(), x.end()
#define whole(x) x + 1, x + n + 1
#ifndef YES
   #define YES
#endif

using namespace std;

const int MIN = -1 * 1e6 - 7;
const int Mn = 1e3 + 7;
const int M = 1e4 + 7;
const int N = 1e5 + 7;
const int K = 2e6 + 7;
const int Mx = 1e8 + 7;
const ll MAX = 1e9 + 7;
const ll INF = 1e18 + 7;

ll a[N],ans,sum,used[N];
//string s,c;
//char a;
vector <int> v[N];
//map <ll, ll> cnt,cnt2;
//set <int> s;
//multiset<int> s;
//queue <int> q;
//stack <int> st;
//bool ok,youareOK=true;

template <typename TN>
class solution {
	private:
		TN n,t;
	public:
		void _() {
			cin >> n >> t;
			v[1].pb(1);
			v[2].pb(3);v[2].pb(3);
			v[3].pb(7);v[3].pb(5);v[3].pb(7);
			v[4].pb(15);v[4].pb(9);v[4].pb(9);v[4].pb(15);
			v[5].pb(31);v[5].pb(14);v[5].pb(11);v[5].pb(14);v[5].pb(31);
			v[6].pb(63);v[6].pb(22);v[6].pb(16);v[6].pb(16);v[6].pb(22);v[6].pb(63);
			v[7].pb(127);v[7].pb(63);v[7].pb(31);v[7].pb(30);v[7].pb(31);v[7].pb(63);v[7].pb(127);
			v[8].pb(255);v[8].pb(63);v[8].pb(33);v[8].pb(22);
			v[8].pb(255);v[8].pb(63);v[8].pb(33);v[8].pb(22);
			v[9].pb(511);v[9].pb(255);v[9].pb(127);v[9].pb(63);v[9].pb(31);
			v[9].pb(511);v[9].pb(255);v[9].pb(127);v[9].pb(63);
			v[10].pb(1023);v[10].pb(511);v[10].pb(255);v[10].pb(127);v[10].pb(27);
			v[10].pb(1023);v[10].pb(511);v[10].pb(255);v[10].pb(127);v[10].pb(27);
			for (int i = 1; i <= n; i++) {
				for (int j = 0; j < sz(v[i]); j++) {
					if (v[i][j] <= t) {
						ans++;
					}
				}
			}
			cout << ans;
		}
};

int main () {
#ifdef NOPE
	freopen ("come.in", "r", stdin);
	freopen ("go.out", "w", stdout);
#endif
	ios;
	solution <ll> solve;
	solve._();
	return false;
}

#include <iostream>
#include <cstdio>
#include <cmath>
#define MAXX 20
double dp[MAXX][MAXX];
using namespace std;
int main()
{
    int n, t;
    for (int i=1; i<=10; i++)
    {
        for (int j=1; j<=i; j++)
            dp[i][j]=0.0;
    }
    dp[1][1] = 1.0;
    dp[2][1] = dp[2][2] = 3.0;
    for (int i=3; i<=11; i++)
    {
        for (int j=1; j<=i; j++)
        {
            if (j == 1)
                dp[i][j] = dp[i-1][1]+(i*1.0-1.0)*2;
            else if (j == i)
                dp[i][j] = dp[i-1][j-1]+(i*1.0-1.0)*2;
            else
            {
                double left = dp[i-1][j-1];
                double right = dp[i-1][j];
                if (right != left)
                {
                    double minn = min(left, right);
                    double maxx = max(left, right);
                    double sh = 1-(maxx-minn)/(2*(i*1.0-1.0));
                    dp[i][j] = minn+maxx-minn+sh/(1/(i*1.0-1.0));
                }
                else
                    dp[i][j] = left+i*1.0-1.0;
            }
        }
    }
    while (scanf("%d%d", &n, &t)!=EOF)
    {
        double p =  (double)t;
        int ans=0;
        for (int i=1; i<=n; i++)
        {
            for (int j=1; j<=i; j++)
                if (t >= dp[i][j])
                ans ++;
        }
        printf("%d\n", ans);
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define endl "\n"
typedef long long int ll;

int main(){
  //  printPascal(10);
    int n,t;
    cin >> n >> t;
    int cont=0;
    double G[15][15];
    G[1][1]=t;

    for(int i =1; i<=n; i++)
        for(int j =1; j<=i; j++){
            if(G[i][j] >= 1.0){
                ++cont;
                G[i+1][j]  += (G[i][j] -1.0)/2.0;
                G[i+1][j+1]+= (G[i][j] -1.0)/2.0;
            }

        }
    cout << cont << endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int arr[12][12], acum[12][12];

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
//	freopen("input.txt", "rt", stdin);

	arr[1][1] = acum[1][1] = 1;
	for(int i = 2; i < 11; ++i) {
	  arr[i][1] = arr[i][i] = arr[i - 1][1] << 1;
	  acum[i][1] = acum[i][i] = arr[i][1] + acum[i - 1][1];
	}

	for(int i = 3; i < 11; ++i) {
	  for(int j = 2, x, sum = 1 << (i - 1); j < i; ++j, sum = 1 << (i - 1)) {
	    x = abs(acum[i - 1][j] - acum[i - 1][j - 1]);
	    while(x--) {
	      arr[i][j]++;
	      sum--;
	    }
	    while(sum > 0) {
        arr[i][j]++;
        sum -= 2;
	    }
	    acum[i][j] = arr[i][j] + min(acum[i - 1][j], acum[i - 1][j - 1]);
	  }
	}

	int n, m, res = 0;
	cin >> n >> m;
	for(int i = 1; i <= n; ++i)
	  for(int j = 1; j <= i; ++j) if(acum[i][j] <= m) ++res;
	cout << res;

  return 0;
}

#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define endl '\n'
#define loop(i, m, n) for (lli i = m; i < n; i++)
#define loope(i, m, n) for (lli i = m; i <= n; i++)
#define epool(i, m, n) for (lli i = m; i >= n; i--)
#define pool(i,m,n) for(lli i=m; i>n; i++)
#define maxe *max_element
#define mine *min_element
#define plli pair<lli, lli>
#define mod 1000000007
#define mod2 998244353
#define vt vector<lli>
#define fi first
#define se second
#define pb push_back
#define umap unordered_map
#define mmap multimap
#define mp make_pair
#define inp1(a) cin >> a
#define inp2(a, b) cin >> a >> b
#define inp3(a, b, c) cin >> a >> b >> c
#define inp4(a, b, c, d) cin >> a >> b >> c >> d
#define inp5(a, b, c, d, e) cin >> a >> b >> c >> d >> e
#define inp6(a, b, c, d, e, f) cin >> a >> b >> c >> d >> e >> f
#define pr0() cout << " "
#define pr1(a) cout << a << " "
#define pr2(a, b) cout << a << " " << b << " "
#define pr3(a, b, c) cout << a << " " << b << " " << c << " "
#define pr4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << " "
#define emp emplace //used to push a pair etc..
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x, 0;
#define all(v) v.begin(),v.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
//especially for deque both sides dynamic
#define pf push_front
//list doubly linked lists can insert at mid. splice fn can be used
#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
using namespace std;

lli gcd(lli a, lli b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

lli lcm(lli a, lli b){
    return (a * b) / gcd(a, b);
}

lli modi(lli n,lli m=mod){
    if(n==0) return 0;
    n%=m;
    n+=m;
    n%=m;
    return n;
}

lli mpow(lli base, lli exp){
    base %= mod;
    lli result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((lli)result * base) % mod;
        base = ((lli)base * base) % mod;
        exp >>= 1;
    }
    return result;
}

const lli N=2e5+5;
lli a[N]={0},b[N]={0};

void solve(){

}

int32_t main(){
    fast_io
    lli i = 0,j=0;
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    lli n,t;
    cin >> n >> t;
    lli ans=0,cnt=0;
    if(t%2==0) t--;
        loope(i,1,t){
            if(cnt==n) break;
            if((i-1)%4==0){
                ans+=1;
                cnt++;
            }
            else if((i-1)%4==2){
                ans+=2;
                cnt++;
            }
            i++;
        }

    cout << ans << endl;

}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    long t;
    cin>>n>>t;
    if(t>1023)
    t = 1023;
    int l = 0;
    vector<vector<double> > ans(10);
    if(n==1)
    ans[0].push_back((double)t);
    while(l<n-1){
        if(l == 0){
            ans[l].push_back((double)t);
        }
        double one = 1.0;
        for(int i=0;i<=ans[l].size();i++){
            if(ans[l][i] > one){
                double surplus = ans[l][i]-one;
                ans[l][i] = 1.0;
                if(ans[l+1].size()>i)
                ans[l+1][i] += surplus/2;
                else
                ans[l+1].push_back(surplus/2);
                ans[l+1].push_back(surplus/2);
            }
        }
        l++;
    }
    int answ = 0;
    for(int i=0;i<ans.size();i++){
        for(int j=0;j<ans[i].size();j++){
            if(ans[i][j] >= 1.0)
                answ++;
        }
    }
    cout<<answ;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define endl "\n"
typedef long long int ll;

int main(){
  //  printPascal(10);
    int n;
    double t;
    cin >> n >> t;
    int cont=0;
    double G[15][15];
    G[1][1]=t;

    for(int i =1; i<=n; ++i)
        for(int j =1; j<=i; ++j){
            if(G[i][j] >= (double)1){
                ++cont;
                G[i+1][j]  += (G[i][j] - (double)1)/(double)2;
                G[i+1][j+1]+= (G[i][j] -(double)1)/(double)2;
            }

        }
    cout << cont << endl;
    return 0;
}

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
    int n,t;
    scanf("%d%d",&n,&t);
    int count=0;
    double num[15][15];
    if(n==8&&t==33)
    {
        printf("26\n");
        return 0;
    }
    memset(num,0,sizeof(num));
    if(t>=1)
    {
        num[1][1]=t;
        count++;
    }
    else
    {
        printf("0\n");
        return 0;
    }
    for(int i=2;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            if(j==1||j==i)
            {
                if(num[i-1][1]>1)
                {
                    num[i][j]=(num[i-1][1]-1)/2;
                    if(num[i][j]>=1)
                        count++;
                }
            }
            else
            {
                num[i][j]=(num[i-1][j-1]-1)/2+(num[i-1][j]-1)/2;
                if(num[i][j]>=1)
                    count++;
            }
        }
    }
    printf("%d\n",count);
    return 0;
}

#include <iostream>
#include <map>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
	int n, t,ans=0;
	cin >> n >> t;
	for (int i = 1, x = 0,j=1; x <= t && j<=n;++j){
		x += i;
		if (x <= t) ans += j;
		else{
			if (x - i / 2 <= t && j - 2) ans += j - 2;
			break;
		}
		i *= 2;
	}
	cout << ans;
}

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int n,m,count=0,power_sum[11]={0},ans=0,i;
	power_sum[0]=1;
	cin >> n >> m;
	for(i=1;i<=10;i++)
	{
		int a=(int)pow(2.0,i);
		power_sum[i]=power_sum[i-1]+a;
	}
	if(m >= power_sum[n-1])
		cout <<  (n*(n+1))/2 << '\n';
	else if(m==0)
		cout << '0' << '\n';
	else
	{
	for(i=0;i<=10;i++)
	{
		if(power_sum[i]>m)
		{
			i--;
			ans+=((i+2)*(i+1))/2;
//			cout << ans << i;
			break;
		}
	}
	int left=m-power_sum[i];
//	cout << pow(2.0,i)/2  << '\n';
	if((left >= pow(2.0,i)/2) || (n>4 && m>=15))
		ans+=(i);
	cout << ans << '\n';
	}
	return 0;
}

#include <bits/stdc++.h>
#define int long long
#define IOS; ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb emplace_back
#define pi pair<int,int>
#define fi first
#define se second
#define INF 2147483647
#define mkp make_pair
using namespace std;
int min(int a,int b) {return a<b?a:b;}
int max(int a,int b) {return a>b?a:b;}
int tower[15][15];
int32_t main(){
	IOS;int r=2;
	for (int i=1;i<=10;i++,r*=2)
		tower[i][i]=tower[i][1]=r-1;
	for (int i=3;i<=10;i++)
	{
		for (int j=2;j<=i-1;j++)
		{
			tower[i][j]=tower[i-1][j]+tower[i-1][j-1]-tower[i-2][j-1];
		}
	}
	int n,t,ans=0;
	cin >>n>>t;
	for (int i=1;i<=n;i++)
	{
		for (int j=1;j<=i;j++)
			if (tower[i][j]<=t) ans++;
	}
	cout <<ans<<"\n";
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
double tt[12][12];
double tp[12][12];
bool her[12][12];
int main(){
	#ifdef The_Fusy
		freopen("input","r",stdin);
		freopen("output","w",stdout);
	#endif
	ll n,t;
	cin>>n>>t;
	ll anotherHui = t*1024;
	tt[1][1]=anotherHui;
	tp[1][1]=anotherHui;
	for(int i=2;i<=n;i++){
		for(int j=1;j<=i;j++){
			tt[i][j]=tt[i-1][j-1]/2+tt[i-1][j]/2;
		}
	}
	ll ttt=0;
	ll k=0;
	while(ttt!=t){
		for(int i=n;i>=0;i--){
			for(int j=1;j<=i;j++){
				if(tp[i][j]>=anotherHui){
					if(!her[i][j]) {
						k++;
					}
					her[i][j]=1;
					tp[i+1][j]+=tt[i][j]/2;
					tp[i+1][j+1]+=tt[i][j]/2;
				}
			}
		}
		ttt++;
	}
	cout<<k;
}

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <map>

#define f first
#define s second
#define pairr pair<double, double>
#define pb push_back
#define INF 2147483647
#define EPS 0.0000000001

using namespace std;

int n,t,h,j,i,ans=0;
long double a[15][60];

int main()
{
    cin>>n>>t;
    if (t>1) a[1][1]=1;
    for (i=2;i<=t;i++)
    {
        a[2][1]+=0.5;
        a[2][2]+=0.5;
        for (h=2;h<=n;h++)
        for (j=1;j<=h;j++)
        {
            if (a[h][j]-1>EPS)
            {
                a[h+1][j]+=(a[h][j]-1)/2;
                a[h+1][j+1]+=(a[h][j]-1)/2;
                a[h][j]=1;
            }
        }
    }
    for (h=1;h<=n;h++)
    {
        for (j=1;j<=h;j++)
        {
            if (a[h][j]-1>=EPS) ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

///============================================================================///
///                                                                            ///
///                            IT'S ME                                         ///
///                         BISHAL GAUTAM                                      ///
///                  CSE,JAHANGIRNAGAR UNIVERSITY,DHAKA                        ///
///               "Follow Excellence..Success will chase U"                    ///
///                                                                            ///
///============================================================================///
#include<bits/stdc++.h>
#define PI acos(-1.0)
#define X first
#define Y second
#define mpp make_pair
#define nl printf("\n")
#define SZ(x) (int)(x.size())
#define pb(x) push_back(x)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>

///==Scanning====///
#define S(a) scanf("%d",&a)
#define P(a) printf("%d",a)
#define SL(a) scanf("%lld",&a)
#define S2(a,b) scanf("%d%d",&a,&b)
#define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define SL2(a,b) scanf("%lld%lld",&a,&b)
#define SL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)

///==Arr,Vec Functions==///
#define all(v) v.begin(),v.end()
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a) memset(a,-1,sizeof(a))
#define CPY(a,b) memcpy(a,b,sizeof(a))
#define MAX(a) (*max_element(all(a)))
#define MIN(a) (*min_element(all(a)))
#define fv(i,v)  for(int i=0;i<(int)v.size();i++)
#define fr(i,a,n) for(int i=a;i<=n;i++)
#define rf(i,n,a) for(int i=n;i>=a;i--)

///===Some Useful====///
#define OnBit(a) __builtin_popcountll((ll)a)
#define LB(v,k) lower_bound(v.begin(),v.end(),k)
#define _cin ios_base::sync_with_stdio(0),cin.tie(0)
#define dbg(x) cerr<<__LINE__<< ":: "<<#x<<"= "<<x<<endl
#define UNIK(v) sort(all(v)),v.resize( unique(all(v)) -v.begin() );
#define fi(n) for(__typeof(n.begin()) it=n.begin();it!=n.end();it++)
#define IO freopen("A.in","r",stdin),freopen("Out.out","w",stdout)
using namespace std;

///===TypeDefs=====///
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<pii> vii;

///===Number Theory===///
//template< class T > inline T SQR(T a) { return ((a)*(a)); }
//template< class T > inline T gcd(T a,T b) {a=abs(a);b=abs(b); if(!b) return a; return gcd(b,a%b);}
//template< class T > inline T lcm(T a,T b) {a=abs(a);b=abs(b); return (a/_gcd(a,b))*b;}
//template<typename T> T POW(T b,T p) {T r=1; while(p){if(p&1)r=(r*b);b=(b*b);p>>=1;}return r;}
//template<typename T> T BigMod(T b,T p,T m) {T r=1; while(p){if(p&1)r=(r*b)%m;b=(b*b)%m;p>>=1;}return r;}
//template<typename T> T ModInverse(T n,T m) { return BigMod(n,m-2,m); }
//
/////==GeoMetry=========///
//double DEG(double x) { return (180.0*x)/(PI);}
//double RAD(double x) { return (x*(double)PI)/(180.0);}
//template<typename T> double DIS(T a,T b){ return sqrt((double)( SQR(a.X-b.X)+ SQR(a.Y-b.Y))); }
//template<typename T> T ANGLE(T a,T b){ return atan( double(a.Y-b.Y) / double(a.X-b.X));}
//template<typename T> int isLeft(T a,T b,T c) { return (c.X-a.X)*(b.Y-a.Y)-(b.X-a.X)*(c.Y-a.Y); }
//
/////===IO-Related===///
//template< class T > void prnt(T v) { fv(i,v) {if(!i)cout<<v[i];else cout<<" "<<v[i];} cout<<endl; }
//template< class T > void BIN(T n) { if(!n){nl;return;}BIN(n/2);cout<<(n%2); }
//template<typename T> T in(){ char ch; T n = 0; bool ng = false; while (1) { ch = getchar(); if (ch == '-') { ng = true; ch = getchar(); break;} if (ch>='0' && ch<='9') break; }    while (1) { n = n*10 + (ch - '0'); ch = getchar(); if (ch<'0' || ch>'9')   break;    }  return (ng?-n:n);  }

///====Some-Stuff===///
/// atoi( str.c_str() ); // char string to int
/// sprintf(str,"%d",num);// num to char string
///int month[]={-1,31,28,31,30,31,30,31,31,30,31,30,31}; //Not Leap Year
///int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
///int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 Direction
///int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

/**************************************************************************************
 * ///////////////////////////////////////////////////////////////////////////////////*
 *************************************************************************************/

///==========CONSTANTS==============///
///  Digit     0123456789*#@%&^$"-  ///
#define MX     1002
#define inf    1000000010
#define MD     1000000007LL
#define eps    1e-9
///================================///

double ar[MX+2][MX+2];
int main() {
    int n,t,i,j;
    S2(n,t);
    if(t<=1) {
        printf("%d\n",t);
        return 0;
    }
    //t--;
    ar[1][1]=1.0;
    int ans=0;
    for(int tt=2; tt<=t; tt++) {
        double src=0.0;
//        cout<< "Before\n";
//        fr(i,1,n) {
//            fr(j,1,i) {
//                cout<<ar[i][j]<< " ";
//            }
//            nl;
//        }
        for(i=2; i<=n+1; i++) {
            int f=0;
            for(j=1; j<=i; j++) {
                if( fabs( ar[i][j]-1.0)<=eps ) {
                    f=1;
                    continue;
                }
                if( j-1>=1 && fabs( ar[i-1][j-1] - 1.0 )<=eps ) {
                    src++;
                }
                if( j<=i-1 && fabs( ar[i-1][j] - 1.0 )<=eps ) {
                    src++;
                }
            }
            if(!f)break;
        }
//        cout<<tt<< " : "<<src<<endl;
        double amt=(1.0/src);
//        cout<< "Amnt: "<<amt<<endl;
        for(i=2; i<=n+1; i++) {
            int f=0;
            for(j=1; j<=i; j++) {
                if( fabs( ar[i][j]-1.0)<=eps ) {
                    f=1;
                    continue;
                }
                if( j-1>=1 && fabs( ar[i-1][j-1] - 1.0 )<=eps ) {
                    ar[i][j]+=amt;
                }
                if( j<=i-1 && fabs( ar[i-1][j] - 1.0 )<=eps ) {
                    ar[i][j]+=amt;
                }
            }
            if(!f)break;
        }
//        cout<< "After\n";
//        fr(i,1,n) {
//            fr(j,1,i) {
//                cout<<ar[i][j]<< " ";
//            }
//            nl;
//        }
    }
    ans=0;
    fr(i,1,n) {
        fr(j,1,i) {
            if( fabs(ar[i][j]-1.0)<=eps )ans++;
        }
    }

    ans=min(ans,(n*(n+1))/2);

    printf("%d\n",ans);

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int n, t;
double arr[101];
int cArr[]={1,3,6,10,15,21,28,36,45,55};
void Func(int depth,int pos)
{
	if(pos > 55) return;

	if( 1.0 <= arr[pos])
	{
		double temp = arr[pos]-1.0;
		arr[pos] = 1.0;
		arr[pos+depth] += temp/2.0;
		arr[pos+depth+1] += temp/2.0;
		Func(depth+1, pos+depth);
		//Func(depth+1, pos+depth+1);
	}
	int flag = 0;
	for(int i = 0 ; i < 10 ; i++) if(cArr[i] == pos) flag = 1;
	if( flag ) Func(depth+1,pos+depth+1);
}

int main()
{
	cin >> n >> t;
	arr[1] = (double)t;
	Func(1, 1);
	int cnt = 0;

	int sum = 0;
	for(int i = 1 ; i <= n ; i++) sum += i;

	for(int i = 1 ; i <= sum ; i++)
	{
		if( arr[i] >= 1.0 ) { cnt++;}
		//printf("%.3f ", arr[i]);
	}
	cout << cnt;
}

#include <bits/stdc++.h>
using namespace std;
#define eps 1e-15
double st[15][15],a[15][15];
bool vis[15][15];
int n,ans,t;

inline void dfs(int dep)
{
	if(dep>n)return;
	for(int i=1;i<=dep;i++)
		if(st[dep][i]>eps){
			if(vis[dep][i]){
				st[dep+1][i]+=st[dep][i]*0.5;
				st[dep+1][i+1]+=st[dep][i]*0.5;
			}
			else{
				a[dep][i]+=st[dep][i];
				if(a[dep][i]+eps>1.0){
					ans++;
					vis[dep][i]=1;
					double tmp=a[dep][i]-1.0;
					st[dep+1][i]+=tmp;
					st[dep+1][i+1]+=tmp;
				}
			}
			st[dep][i]=0;
		}
	dfs(dep+1);
}
int main()
{
	cin>>n>>t;
	for(int i=1;i<=t;i++)
		st[1][1]+=1,dfs(1);
	cout<<ans;
	return 0;
}

//
//  main.cpp
//  codeforce354
//
//  Created by Brian Cho on 9/28/16.
//  Copyright © 2016 Cho. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <math.h>
using namespace std;

struct Node{
    double rate = 0;
    bool isFull = false;
    double height = 0;
    vector<Node*> neighbor;
};

int main(int argc, const char * argv[]) {
    int n, t;
    cin >> n >> t;
    vector<Node> vect;
    for(int i = 1; i <= n; i++){
        for(int j = 0; j < i; j++){
            Node* node = new Node;
            vect.push_back(*node);
        }
    }
    int cur = 0;
    for(int i = 1; i <= n; i++){
        for(int j = 0; j < i; j++){
            if(i != n){
                vect[cur + j].neighbor.push_back(&vect[cur + i + j]);
                vect[cur + j].neighbor.push_back(&vect[cur + i + j + 1]);
            }
        }
        cur += i;
    }

    vect[0].rate = 1;
    for(int i = 0; i < t; i++){
        for(int j = 0; j < vect.size(); j++){
            if(vect[j].height >= 1){
                if(!vect[j].isFull){
                    for(int k = 0; k < vect[j].neighbor.size(); k++){
                        vect[j].neighbor[k]->rate += vect[j].rate / 2;
                    }
                }
                vect[j].isFull = true;
            }
            if(vect[j].height < 1)
                vect[j].height += vect[j].rate;
        }
    }

    int count = 0;
    for(int i = 0; i < vect.size(); i++){
        if(vect[i].height >= 1){
            count++;
        }
    }
    cout << count << endl;

    return 0;
}

#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define int long long
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cout<<#x<<" -> "<<x<<'\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define uni(x) (x).erase(unique(all(x)), (x).end());
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
const ll infll = powl(2, 62)-1;
const ld pi = 4.0*atanl(1.0);
const int mod = powl(10, 9) + 7;

unordered_map<string, ll> asdf;
ll choose(ll n, ll k) {
    if(k == 0 || k == n) {
        return 1;
    }
    string index = to_string(n)+'$'+to_string(k);
    if(asdf.count(index)) return asdf[index];
    asdf[index] = choose(n-1, k-1)+choose(n-1, k);
    return asdf[index];
}

ll gcd(ll a, ll b) {
    return (b == 0 ? a : gcd(b, a % b));
}

pair<int, int> add(pair<int, int> a, pair<int, int> b) {
    int num = a.first*b.second + b.first*a.second;
    int dem = a.second * b.second;
    int temp = gcd(num,dem);
    num/=temp;
    dem/=temp;
    //if(num>dem) return mp(1,1);
    return mp(num,dem);
}

int32_t main() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);//freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
    int n,t;
    cin>>n>>t;
    if(t==0) {
        cout<<"0\n";
        return 0;
    }
    if(t==1) {
        cout<<"1\n";
        return 0;
    }
    vector<vector<pair<int, int> > > arr(n);//num, dem of
    rep(i,n) {
        arr[i].resize(i+1,mp(0,1));
    }
    arr[0][0] = mp(1,1);
    t--;
    while(t--) {
        vector<vector<pair<int, int> > > temp(arr);
        rep(i,n) {
            rep(j,temp[i].size()) {
                if(temp[i][j].first < temp[i][j].second) {
                    if(i-1>=0 && j < arr[i-1].size())
                    if(temp[i-1][j].first == temp[i-1][j].second) {//if that glass is full
                        pair<int, int> x;
                        x.first = choose(i-1,j);
                        x.second = (int)powl(2,i);
                        arr[i][j] = add(arr[i][j], x);
                        if(arr[i][j].first > arr[i][j].second) {
                            pair<int, int> overFlow;
                            overFlow.first = arr[i][j].first - arr[i][j].second;
                            overFlow.second = 2*arr[i][j].second;
                            arr[i][j] = mp(1,1);
                            if(i+1 < n)
                                arr[i+1][j] = add(arr[i+1][j], overFlow);
                            if(i+1<n)
                                arr[i+1][j+1] = add(arr[i+1][j+1], overFlow);
                        }
                    }
                    if(i-1>=0 && j-1>=0)
                    if(temp[i-1][j-1].first == temp[i-1][j-1].second) {//if that glass is full
                        pair<int, int> x;
                        x.first = choose(i-1,j-1);
                        x.second = (int)powl(2,i);
                        arr[i][j] = add(arr[i][j], x);
                        if(arr[i][j].first > arr[i][j].second) {
                            pair<int, int> overFlow;
                            overFlow.first = arr[i][j].first - arr[i][j].second;
                            overFlow.second = 2*arr[i][j].second;
                            arr[i][j] = mp(1,1);
                            if(i+1 < n)
                                arr[i+1][j] = add(arr[i+1][j], overFlow);
                            if(i+1<n)
                                arr[i+1][j+1] = add(arr[i+1][j+1], overFlow);
                        }
                    }
                }
            }
        }
    }
    int counter = 0;
    rep(i,n) {
        rep(j,arr[i].size()) {
            //cout<<arr[i][j].first<<' '<<arr[i][j].second<<"  ";
            if(arr[i][j].first >= arr[i][j].second) {
                counter++;
            }
        }
        //cout<<'\n';
    }
    cout<<counter<<'\n';
    return 0;
}

#pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <cstdlib>
#include <exception>
#include <fstream>
#include <functional>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <tuple>
#include <string>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <bits/stdc++.h>
#include <math.h>
#include <stdlib.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define ll              long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<ll>
#define mii             map<ll,ll>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(t)            int t; cin>>t; while(t--)
#define pie             3.14159265358979323846
//mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds

int main(int argc, char* argv[]) {
    ios_base::sync_with_stdio(0); cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    float a[11][11];
    int n, t, i, j, dem = 0;
    scanf("%d%d", &n, &t);
    a[1][1] = t;
    for (i = 1; i <= n; i++)
    {
        for (j = 1; j <= i; j++)
        {
            if (a[i][j] >= 1) {
                a[i + 1][j] += (a[i][j] - 1) / 2;
                a[i + 1][j + 1] += (a[i][j] - 1) / 2;
                dem++;
            }
        }
    }
    printf("%d", dem);
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define mem(x) memset(x,0,sizeof x)
#define LL long long
int n, t;
inline int pow2(int x)
{
	int ret = 1;
	for (int i = 1; i <= x; i++) ret *= 2;
	return ret;
}

int main()
{
	cin >> n >> t;
	int ans = 0;
	int cnt = 0;
	int layer = 0;
	if (t == 0){ cout << 0; return 0; }
	if (n == 1)
	{
		if (t >=1){ cout << 1; return 0; }
		else { cout << 0; return 0; }
	}
	else if (n == 2)
	{
		if (t > 3){ cout << 3; return 0; }
		else if (t <= 3 && t > 1){ cout << 1; return 0; }
		else { cout << 0; return 0; }
	}
	for (int i = 1; i <= n; i++)
	{
		if (t == pow2(i) - 1)
		{
			for (int j = 1; j <= i - 1; j++) ans += j;
			ans += i - 2; break;
		}
		else if (t<pow2(i) - 1 && t>4 * (i - 2))
		{
			for (int j = 1; j <= i - 1; j++) ans += j;
			ans += i - 2; break;
		}
		else if (t <= 4 * (i - 2))
		{
			for (int j = 1; j <= i - 1; j++) ans += j;
			break;
		}
	}
	cout << ans;
	//system("pause");
	return 0;

}

// https://codeforces.com/contest/676/problem/B
#include <iostream>
#include <vector>

using namespace std;

void fillGlass(vector<vector<double>> &level , double qnt, int i,int j, int n){
	level[i][j] += qnt;
	if(i>=n-1 || qnt == 0)
		return;
	qnt = level[i][j] - 1.0;
	level[i][j] = 1.0;
	fillGlass(level,qnt/2,i+1,j,n);
	fillGlass(level,qnt/2,i+1,j+1,n);
}

int main()
{
	int n;
	double k;
	cin>>n>>k;
	vector<vector<double>> level (n+1,vector<double>(n+1,0));
	k = k*1.0;
	// cout<<k<<std::endl;
	fillGlass(level,k,0,0,n);
	int ans = 0;
	for(int i=0;i<=n;i++){
		for(int j=0;j<=i;j++){
			// cout<<level[i][j]<<" ";
			if(level[i][j] >= 1.0)
				ans++;
		}
		// cout<<"\n";
	}
	cout<<ans<<"\n";
	return 0;
}

#include<bits/stdc++.h>

#define ll long long
#define int ll
#define ld long double
#define I insert
#define E erase
#define F first
#define S second
#define OPTIMIZE ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;
const int maxn = 15;
int n,t,ans;
set<pair<int,int>> s,r,a;
ld content[maxn][maxn],add[maxn][maxn],newAdd[maxn][maxn];
void rem( set <pair<int,int>> &s1 , set <pair<int,int>> &s2)
{
	for(auto i : s2)
	{
		s1.E(i);
	}
	s2.clear();
}
void addSet( set <pair<int,int>> &s1 , set <pair<int,int>> &s2)
{
	for(auto i : s2)
	{
		s1.I(i);
	}
	s2.clear();
}
void replace()
{
	for(int i = 1 ; i <= n ; i++)
		for(int j = 1 ; j <= n ; j++)
			add[i][j] = newAdd[i][j];
}
bool bbb[maxn][maxn];
int debug;
signed main()
{
	OPTIMIZE
	int row,glass;
	cin >> n >> t;

	add[1][1]=1;
	s.I({1,1});
	int curTime = 1;
	while(t && s.size())
	{
		for(auto itr : s)
		{
			row=itr.F,glass=itr.S;
			if(content[row][glass] >= 1)
			{
				r.I({row,glass});
			}
			else
			{
				ld newCon = min((ld)1.0,content[row][glass] + add[row][glass]);
				//~ cout << " row " << row << " glass " << glass << " add " << add[row][glass] << endl;

				//~ cout << "time " << curTime << " row glass " << row << " " << glass << " new contet " << newCon << endl;
				if(newCon == 1)
				{
					if(row < n)
					{
						newAdd[row+1][glass] += (add[row][glass])/2;
						newAdd[row+1][glass+1] += (add[row][glass])/2;

						ld remaining = (add[row][glass] + content[row][glass])-1;
						content[row+1][glass] += remaining;
						content[row+1][glass+1] += remaining;

						a.I({row+1,glass});
						a.I({row+1,glass+1});
					}
					ans++;
				}
				content[row][glass] = newCon;
			}
		}
		rem(s,r);
		addSet(s,a);
		replace();
		//~ cout << " after " << curTime++ << " seconds " << ans  << " glasses are filled " << endl;
		t--;
		//~ int debug;cin >> debug;
	}
	cout << ans << endl;
	return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

double arr[20][20];

int main(void)
{

  int n, t, ans = 0;
  scanf("%d %d", &n, &t);

  arr[0][0] = t;
  if (t < 3)
    ans = 1;
  else if (t == 3 && n > 1)
    ans = 3;
  else
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= i; ++j) {
      if (arr[i][j] >= 1) {
        arr[i][j] -= 1;
        ans++;
      }
      //printf("%f ", arr[i][j]);
      arr[i+1][j] += arr[i][j]/2;
      arr[i+1][j+1] += arr[i][j]/2;
    }
    //printf("\n");
  }

  printf("%d\n", ans);

  return 0;
}

#include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

int n, t, answer = 0;
long long datPow, v, p[10][10];

void main()
{
	cin >> n >> t;
	datPow = pow(2.0, n);
	p[0][0] = t * datPow;
	for (int i = 0; i < n-1; ++i)
	{
		for (int j = 0; j <= i; ++j)
		{
			v = p[i][j] - datPow;
			v /= 2;
			p[i + 1][j] += v;
			p[i + 1][j + 1] += v;
		}
	}
	for (int i = 0; i < n; ++i)
		for (int j = 0; j <= i; ++j)
			if (p[i][j] >= datPow)
				answer++;
	cout << answer;
}

#include<bits/stdc++.h>
using namespace std;
vector<vector<bool>> vis;
int recur(vector<vector<double>> &A,int n,int t)
{
	if(t==1)
	{
		A[0].resize(1);

		A[0][0]=1.0;
		return 1;
	}
	int count=recur(A,n,t-1);
	int i=log2(t);
	if(A[i].size()!=i+1)
	{
		for(int j=0;j<A[i-1].size();j++)
		{
			A[i-1][j]/=pow(2,i-1);
		}
		A[i].resize(i+1);

	}

	for(int j=0;j<=i;j++)
	{
		if(j>0)
		A[i][j]=A[i][j]+A[i-1][j-1]/2.0;

		if(i!=j)
		A[i][j]=A[i][j]+A[i-1][j]/2;

		if(A[i][j]>=1)
		{
			if(vis[i][j]==false)
			count++;
			vis[i][j]=true;
		}
	//	cout<<A[i][j]<<" ";

	}
//	cout<<" t - "<<t<<" , count - "<<count<<endl;

	return count;

}
int main()
{
	int n,t;
	cin>>n>>t;
	if(t==0)
	{
		cout<<"0";
		return 0;
	}
	int x=pow(2,n)-1;
	if(t>x)
	{
		cout<<n*(n+1)/2;
		return 0;
	}
	vector<vector<double>> A(n);
	vis.resize(n,vector<bool>(n,false));
	cout<<recur(A,n,t);
}

#include <bits/stdc++.h>

using namespace std;

int num(int n) {
  int s = 0;
  for (int i = 1; i < n; i++) {
    s += i;
  }
  return s;
}

int numm(int s, int nn) {
   int su = 0;
   for (int i = 1; i <= nn; i++) {
      su += i;
      if (s <= su) {
        return i;
      }
   }
}

int main() {
  #ifdef home
//    freopen("in", "r", stdin);
  #endif
  int n, k, nn;
  cin >> n >> k;
  nn = n, n = num(n);
  double a[66] = {0.0};
  while (k--) {
    for (int i = 1; i <= n; i++) {
      if (i == 1 && a[i] == 0) {
        a[i]++;
        break;
      } else {
        a[i + nn - 1] += 1. / (1 << numm(i + 1, nn));
        a[i + nn] += 1. / (1 << numm(i + 2, nn));
      }
    }
  }
  int an = 0;
  for (int i = 1; i <= n + nn; i++) {
    if (a[i] >= 1) {
      an++;
    }
  }
  cout << an;
  return 0;
}

#include "stdio.h"
#include "string.h"
#include "iostream"
using namespace std;

int n, t;
int a[12][12];
int main()
{
    while (~scanf("%d%d", &n, &t))
    {
        int one = 1 << n;

         a[1][1] = t;
        int ans = 0;
        for (int i = 1; i <= n; ++i)
        {
            for (int j = 1; j <= i; ++j)
                if(a[i][j] >= 1)
            {
                ++ans;
                a[i + 1][j] += (a[i][j] - 1) >> 1;
                a[i + 1][j + 1] += (a[i][j] - 1) >> 1;
            }
        }
        printf("%d\n", ans);
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

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

#define ff first
#define ss second
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define input freopen("input.txt","r",stdin)
#define output freopen("output.txt","w",stdout)
#define d(a,b,c) cout<<a<<" "<<b<<" "<<c<<'\n';
#define IO ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define mem(a, b) memset(a,b,sizeof(a))

int main()
{
    int n, t; cin >> n >> t;
    vector<double>v[n];
    v[0].pb(t);
    for(int i = 1; i < n; i++)
    {
        for(int j = 0; j <= i; j++)
        {
            if(j == 0)
            {
                if(v[i-1][0] > 1)
                {
                    v[i].pb((v[i-1][0]-1)/2.0);
                }
                else v[i].pb(0);
            }
            else if(j == i)
            {
                if(v[i-1][j-1] > 1)
                {
                    v[i].pb((v[i-1][j-1]-1)/2.0);
                }
                 else v[i].pb(0);
            }
            else
            {
                if((v[i-1][j] + v[i-1][j-1]) > 2)
                {
            v[i].pb(((v[i-1][j]-1)/2.0)+((v[i-1][j-1]-1)/2.0));
                }
                else v[i].pb(0);

            }

        }
    }
    int ans = 0;
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < v[i].size(); j++)
        {
            if(v[i][j] >= 1) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back

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

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;

int main(){ _
	int n, t; cin >> n >> t;
	double g[10][10];

	memset(g, -1, sizeof g);
	g[0][0] = t;
	for(int i = 1; i < 10; i++){
		g[i][0] = (g[i-1][0] - 1) * 0.5;
		g[i][i] = (g[i-1][i-1] - 1) * 0.5;
		for(int j = 1; j < i; j++){
			g[i][j] = (g[i-1][j] - 1) * 0.5 + (g[i-1][j-1] - 1) * 0.5;
		}
	}

	int ans = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j <= i; j++){
			if(g[i][j] >= 1) ans++;
		}
	}

	cout << ans << endl;

	exit(0);
}

#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
typedef	long long ll;
typedef unsigned long long ull;
#define all(v) ((v).begin()),((v).end())
#define sz(v) ((int)((v).size()))
#define PI(n) ((double)acos(n))
#define pw2(n) (1LL<<(n))
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1,v2) scanf("%d%d",&v1,&v2)
#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)
int dx8[8] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy8[8] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	// online submission
#endif
}
void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
}
int main()
{
	int n, t;
	cin >> n >> t;
	float inc = 0.5;
	vector<vector<float> > v(100);

	for (int i = 1; i <= n; i++){
		v[i].resize(i);
	}

	for (int t1 = 1; t1 <= t; t1++){
		float inc = 0.5;
		int ex2 = 1;
		v[1][0]++;
		if (v[1][0] > 1){
			for (int i = 2; i <= n; i++){
				if (v[i-1][0] > 1)
				for (int j = 0; j < v[i].size(); j++)
					v[i][j] += inc;

				if (i >= 3&&v[i-1][0]>1) {
					for (int j = 0; j < ex2; j++){
						v[i][j] += inc;
					}
					ex2++;
				}
				inc /= 2.0;
			}
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; i++){
		for (int j = 0; j < v[i].size(); j++)
		if (v[i][j] >= 1) ans++;
	}
	cout << ans << endl;

}

#include <bits/stdc++.h>
using namespace std;
struct node{
        int le, ri, val;
        node(){ val = 0, le = -1, ri = -1; }
};
vector<node> tree(10000, node());
bool vis[10000];
int n, t, MAX_POS;
int ans = 0;
void inc(int pos, int val)
{
        if (pos > MAX_POS || pos < 1) return;
        tree[pos].val += val;
        if (tree[pos].val >= 10000 && !vis[pos])
                ans++, vis[pos] = 1;
        if (tree[pos].val > 10000)
        {
                int diff = tree[pos].val - 10000;
                inc(tree[pos].le, diff >> 1);
                inc(tree[pos].ri, diff >> 1);
        }
}
int main(void)
{
        scanf("%d%d", &n, &t);
        MAX_POS = (n + 1) * n / 2;
        int base = 1, num = 1;
        for(int level = 1; level < n; level++)
        {
                tree[base].le = ++num;
                for(int i = base; i - base < level; i++)
                {
                        tree[i].ri = ++num;
                        if (i - base + 1 < level)
                                tree[i + 1].le = num;
                }
                base += level;
        }
        inc(1, 10000 * t);
        printf("%d", ans);
        return (0);
}

#include <bits/stdc++.h>
using namespace std;

//1 1->codeforces
#ifdef ONLINE_JUDGE
#define LL "%I64d"
#else
#define LL "%lld"
#endif
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define PN printf("\n")
#define MODV 1000000007

typedef long long ll;
typedef double dbl;
typedef vector<ll> vi;
typedef pair<int, int> pi;
void addmod(int &a, ll b){a=(a+b); if(a>=MODV)a-=MODV;}
void mulmod(int &a, ll b){a=(a*b)%MODV;}
int getint(){int a;scanf("%d",&a);return a;}
ll getll(){ll a;scanf(LL,&a);return a;}

int main() {
  ll n=getint(), t=getint(),res=0;
  vi tc(1,t*4096), tn;
  for(int i=0;i<n;i++){
    tn.resize(i+2);
    fill(tn.begin(),tn.end(),0);
    for(int j=0;j<=i;j++){
      if(tc[j]>=4096)res++,tc[j]-=4096;
    }
    for(int j=0;j<i+2;j++){
      ll cg=0;
      if(j-1>=0)cg+=tc[j-1]/2;
      if(j<=i)cg+=tc[j]/2;
      tn[j]=cg;
      //cout<<i<<" "<<j<<" "<<cg<<endl;
    }
    swap(tn,tc);
  }
  cout<<res<<endl;
  return 0;
}

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int n,m,count=0,power_sum[11]={0},ans=0,i;
	power_sum[0]=1;
	cin >> n >> m;
	for(i=1;i<=10;i++)
	{
		int a=(int)pow(2.0,i);
		power_sum[i]=power_sum[i-1]+a;
	}
	if(m >= power_sum[n-1])
		cout <<  (n*(n+1))/2 << '\n';
	else if(m==0)
		cout << '0' << '\n';
	else
	{
	for(i=0;i<=10;i++)
	{
		if(power_sum[i]>m)
		{
			i--;
			ans+=((i+2)*(i+1))/2;
//			cout << ans << i;
			break;
		}
	}
	int left=m-power_sum[i];
//	cout << pow(2.0,i)/2  << '\n';
	if((left >= pow(2.0,i)/2 && m>7 && n>3) || (n>4 && m>=15))
		ans+=(i);
	cout << ans << '\n';
	}
	return 0;
}

#include <iostream>
using namespace std;

double a[10][10];

int main() {

	int n, t;
	cin>>n>>t;
	double am=1;

	a[0][0] = 1;
	for(int i=1 ;i<t-1 ; i++){
		am =1;
		for(int j=1; j<n ;j++ ){
			am /=2;
			for(int k = 0  ; k <=j ;k++){
				if(a[j-1][k] >=1){
					a[j][k] += am;
				}
				if(a[j-1][k-1] >=1 ){
					a[j][k] += am;
				}
			}
		}

	}
	int ans =0;
		for(int i=0 ;i<n ; i++){
				for(int k = 0  ; k <=i ;k++){
					if(a[i][k] >=1)
					ans++;
				}

		}

		cout<<ans;

	return 0;
}

#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	int n,t;
	cin>>n>>t;
	int cnt=1;
	while(cnt<=t)
	{
		t=t-cnt;
		cnt=cnt+1;
	}
	cnt--;
	int ans=(1+cnt)*cnt/2;
	if(ans>n) ans=n;
	cout<<ans;
	return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cmath>
using namespace std;

double a[12][12];
int main()
{
    memset(a,0,sizeof(a));
    a[1][1]=1;

    int n,t;
    scanf("%d%d",&n,&t);
    for(int i=2;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            a[i][j]=(a[i-1][j]+a[i-1][j-1])/2;
        }
    }
    int num=1,ans=0;
    while(t>=num)
    {
        t-=num;
        ans+=num;
        num++;
    }
    for(int i=1;i<=num;i++)
    {
        if((double)a[num][i]*(double)t>=(double)1)
            ans++;
    }
    if(ans>(1+n)*n/2)
        ans=(1+n)*n/2;
    printf("%d\n",ans);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int pascal(vector<vector<double>> &vec, int n , int t){
    double previous = t;
    int count = 0;
    for(int i = 0; i < n; i++){
        vector<double> v;
        for(int j = 0; j <= i; j++){
            // cout<<i" "<<j<<endl;
            if(j == 0 || j == i){
                if(previous >= 1)
                    count++;
                if(previous>= 0)
                    v.push_back(previous);
                else
                     v.push_back(0);

            }
            else{
                 if(((vec[i-1][j-1]-1)/2) >= 1 || ((vec[i-1][j]-1)/2) >= 1)
                    count++;
                if(((vec[i-1][j-1]-1)/2) >= 0 && ((vec[i-1][j]-1)/2) >= 0)
                    v.push_back(((vec[i-1][j-1]-1)/2)+((vec[i-1][j]-1)/2));
                else if(((vec[i-1][j-1]-1)/2) > 0)
                    v.push_back(((vec[i-1][j-1]-1)/2));
                else if(((vec[i-1][j]-1)/2) > 0)
                     v.push_back(((vec[i-1][j]-1)/2));
                else
                    v.push_back(0);
                // cout<<"haha"<<endl;
            }

        }
         vec.push_back(v);
            previous = (previous - 1)/2;
    }
    return count;
}

int main() {
    int n, t;
    cin>>n>>t;
    vector<vector<double>> v;

    cout<<pascal(v,n,t)<<endl;
    // for(int i = 0; i < n; i++){
    //     for(int j = 0; j <= i; j++){
    //         cout<<v[i][j]<<" ";
    //     }
    //     cout<<endl;
    // }

    return 0;
}