Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is n. The top level consists of only 1 glass, that stands on 2 glasses on the second level (counting from the top), then 3 glasses on the third level and so on.The bottom level consists of n glasses.Vlad has seen in the movies many times how the champagne beautifully flows from top levels to bottom ones, filling all the glasses simultaneously. So he took a bottle and started to pour it in the glass located at the top of the pyramid.Each second, Vlad pours to the top glass the amount of champagne equal to the size of exactly one glass. If the glass is already full, but there is some champagne flowing in it, then it pours over the edge of the glass and is equally distributed over two glasses standing under. If the overflowed glass is at the bottom level, then the champagne pours on the table. For the purpose of this problem we consider that champagne is distributed among pyramid glasses immediately. Vlad is interested in the number of completely full glasses if he stops pouring champagne in t seconds.Pictures below illustrate the pyramid consisting of three levels.

The only line of the input contains two integers n and t (1 ≤ n ≤ 10, 0 ≤ t ≤ 10 000) — the height of the pyramid and the number of seconds Vlad will be pouring champagne from the bottle.

Print the single integer — the number of completely full glasses after t seconds.

NoteIn the first sample, the glasses full after 5 seconds are: the top glass, both glasses on the second level and the middle glass at the bottom level. Left and right glasses of the bottom level will be half-empty.

using System;

namespace PyramidOfGlasses
{
    partial class PyramidOfGlasses
    {
        static void Main(string[] args)
        {
            int n, t, answer = 0; ;
            double rem;

            n = NextInt();
            t = NextInt();

            double[][] tree = new double[11][];

            for (int i = 0; i < 11; i++)
                tree[i] = new double[i + 1];

            while (t > 0)
            {
                tree[0][0] += 1.0;

                for (int i = 0; i < n; i++)
                {
                    for (int j = 0; j < tree[i].Length; j++)
                    {
                        rem = tree[i][j] - 1.0;

                        if (tree[i][j] > 1.0)
                        {
                            tree[i][j] = 1.0;
                            tree[i + 1][j] += (rem / 2);
                            tree[i + 1][j + 1] += (rem / 2);
                        }
                    }
                }

                t--;
            }

            for (int i = 0; i < n; i++)
                for (int j = 0; j < tree[i].Length; j++)
                    if (tree[i][j] == 1.0)
                        answer++;

            Console.WriteLine(answer);
        }
    }

    partial class PyramidOfGlasses
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace TaskB
{
    class Program
    {
        static void Main(string[] args)
        {
            new Solver().Solve().OutputResult();
        }

        private class ExtendedReader : StreamReader
        {
            private static readonly char Separator = ' ';

            public ExtendedReader(Stream stream) : base(stream) { }
            public ExtendedReader(Stream stream, bool detectEncodingFromByteOrderMarks) : base(stream, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(Stream stream, Encoding encoding) : base(stream, encoding) { }
            public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(stream, encoding, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }
            public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize, bool leaveOpen) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize, leaveOpen) { }
            public ExtendedReader(string path) : base(path) { }
            public ExtendedReader(string path, bool detectEncodingFromByteOrderMarks) : base(path, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(string path, Encoding encoding) : base(path, encoding) { }
            public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(path, encoding, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(path, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }

            public char ReadChar()
            {
                return (char)this.Read();
            }

            public double ReadDoubleFromArray()
            {
                StringBuilder sb = new StringBuilder();
                char ch = this.ReadChar();
                while (ch != Separator && ch != '\n')
                {
                    sb.Append(ch);
                    ch = this.ReadChar();
                }
                return Convert.ToDouble(sb.ToString());
            }

            public int ReadInt()
            {
                return int.Parse(this.ReadLine());
            }

            public Int64 ReadInt64()
            {
                return Int64.Parse(this.ReadLine());
            }

            public int[] ReadIntArray()
            {
                return this.ReadLine().Split(' ').Select(int.Parse).ToArray();
            }

            public char[] ReadCharArray()
            {
                return this.ReadLine().ToCharArray();
            }

            public string ReadString()
            {
                return this.ReadLine();
            }

            public Int64[] ReadInt64Array()
            {
                return this.ReadLine().Split(Separator).Select(Int64.Parse).ToArray();
            }

            public Double[] ReadDoubleArray()
            {
                return this.ReadLine().Split(Separator).Select(Double.Parse).ToArray();
            }
        }

        private abstract class SolverBase
        {
            protected readonly ExtendedReader _reader;
            protected readonly TextWriter _writer;

            protected SolverBase()
            {
#if DEBUG
                _reader = new ExtendedReader(@"input.txt");
                //_writer = new StreamWriter(@"output.txt");
                _writer = new StreamWriter(Console.OpenStandardOutput());
#else
                _reader = new ExtendedReader(Console.OpenStandardInput());
                _writer = new StreamWriter(Console.OpenStandardOutput());
#endif
            }

            public abstract Solver Solve();

            public abstract void OutputResult();
        }

        private class Solver : SolverBase
        {
            private int result = 0;

            public override Solver Solve()
            {
                // link to task: http://codeforces.com/contest//problem/B

                var input = _reader.ReadIntArray();
                int height = input[0];
                int time = input[1];
                var glasses = new double[Enumerable.Range(1, height).Sum()];

                for (; time > 0; time --)
                {
                    var fillResult = FillGlasses(glasses, 0, 0);
                    if (!fillResult) break;
                }

                result = glasses.Count(x => x >= 1);

                return this;
            }

            private bool FillGlasses(double[] glasses, int index, int level)
            {
                if (glasses.Length > index)
                {
                    if (glasses[index] < 1.0)
                    {
                        glasses[index] += 1.0/Math.Pow(2, level);
                        return true;
                    }

                    var r1 = FillGlasses(glasses, index + level + 1, level + 1);
                    var r2 = FillGlasses(glasses, index + level + 2, level + 1);

                    return r1 || r2;
                }

                return false;
            }

            public override void OutputResult()
            {
                string answer = result.ToString();

                _writer.WriteLine(answer);
                _writer.Dispose();
            }
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
using StringBuilder = System.Text.StringBuilder;
using System.Numerics;
using Number = System.Int64;
namespace Program
{

    public class Solver
    {
        public void Solve()
        {
            var n = sc.Integer();
            var m = sc.Integer();
            var a = Enumerate(n + 1, x => new double[n + 1]);
            for (int _ = 0; _ < m; _++)
            {
                a[0][0] += 1;
                for (int i = 0; i < n; i++)
                    for (int j = 0; j <= i; j++)
                    {
                        if (a[i][j] + 1e-12 >= 1.0)
                        {
                            var rem = a[i][j] - 1;
                            a[i][j] = 1;
                            rem /= 2;
                            a[i + 1][j] += rem;
                            a[i + 1][j + 1] += rem;
                        }
                    }
            }
            var cnt = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j <= i; j++)
                    if (a[i][j] + 1e-12 >= 1) cnt++;
            IO.Printer.Out.WriteLine(cnt);
        }
        public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
        static T[] Enumerate<T>(int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }
        static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
    }
}

#region main
static class Ex
{
    static public string AsString(this IEnumerable<char> ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }
    static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
    static public void Main()
    {
        var solver = new Program.Solver();
        solver.Solve();
        Program.IO.Printer.Out.Flush();
    }
}
#endregion
#region Ex
namespace Program.IO
{
    using System.IO;
    using System.Text;
    using System.Globalization;
    public class Printer : StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, T[] source) { base.Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, T[] source) { base.WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(Stream stream) { str = stream; }
        public readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        private byte read()
        {
            if (isEof) return 0;
            if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while ((b < 33 || 126 < b) && !isEof); return (char)b; }

        public string Scan()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
        public string ScanLine()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b != '\n'; b = (char)read())
                if (b == 0) break;
                else if (b != '\r') sb.Append(b);
            return sb.ToString();
        }
        public long Long()
        {
            if (isEof) return long.MinValue;
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != 0 && b != '-' && (b < '0' || '9' < b));
            if (b == 0) return long.MinValue;
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
        public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }
        public double Double() { var s = Scan(); return s != "" ? double.Parse(s, CultureInfo.InvariantCulture) : double.NaN; }
        private T[] enumerate<T>(int n, Func<T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f();
            return a;
        }

        public char[] Char(int n) { return enumerate(n, Char); }
        public string[] Scan(int n) { return enumerate(n, Scan); }
        public double[] Double(int n) { return enumerate(n, Double); }
        public int[] Integer(int n) { return enumerate(n, Integer); }
        public long[] Long(int n) { return enumerate(n, Long); }
    }
}
#endregion

using System;

namespace Project
{
    class Program
    {
        static void Main(string[] args)
        {
            String[] stringValue;
            Int32 n, nn, nnn, t, i, ii, iii, value;
            Glass[] glasses;
            stringValue = Console.ReadLine().Split(' ');
            n = Convert.ToInt32(stringValue[0]);
            t = Convert.ToInt32(stringValue[1]);
            for (i = n, nn = 0; i > 0; i--)
                nn += i;
            glasses = new Glass[nn];
            for (i = 0; i < nn; i++)
                glasses[i] = new Glass();
            for (i = 0, ii = 0, iii = 1, nnn = 0; i < n - 1; i++)
            {
                nnn += i + 1;
                while (ii < nnn)
                {
                    glasses[ii].Left = iii;
                    glasses[ii].Right = ++iii;
                    ii++;
                }
                iii++;
            }
            n = 2 << n;
            nnn = 0;
            glasses[0].Value = n * t;
            for (i = 0; i < nn; i++)
                if ((glasses[i].Value -= n) >= 0)
                {
                    if (glasses[i].Right > 0 && glasses[i].Left > 0)
                    {
                        glasses[i].Value /= 2;
                        glasses[glasses[i].Right].Value += glasses[i].Value;
                        glasses[glasses[i].Left].Value += glasses[i].Value;
                    }
                    nnn++;
                }
            Console.WriteLine(nnn);
        }

        public class Glass
        {
            private Int32 right, left, value;
            public Int32 Right { get { return right; } set { right = value; } }
            public Int32 Left { get { return left; } set { left = value; } }
            public Int32 Value { get { return value; } set { this.value = value; } }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Security.Policy;
using System.Text;

namespace _
{
    partial class Program
    {
        static partial void Test();

        private static void Main(string[] args)
        {
            Test();

            using (var cin = new Cin())
            using (var cout = new Cout())
            {
                var n = cin.ReadInt();
                var t = cin.ReadInt();

                var result = Solve(n, t);

                cout.Write(result);
            }
        }

        private static int Solve(int n, int t)
        {
            if (t <= 1) return t;

            int c = 1;
            var v = new decimal[n];
            v[0] = t;
            for(int i=1; i<n; i++)
            {
                var p = 0m;
                for(int j=0; j<=i; j++)
                {
                    var a = v[j] - 1;
                    a = a >= 0 ? a/2 : 0;
                    p += a;
                    c += p >= 1 ? 1 : 0;
                    v[j] = p;
                    p = a;
                }
            }

            return c;
        }
    }

    #region Boilerplate
    internal class Cin : StreamReader
    {
        public Cin() : this(Console.OpenStandardInput(65536)) {}
        public Cin(Stream stream) : base(stream, Encoding.ASCII, false){}
        public int ReadInt(){return (int) ReadLong();}
        public long ReadLong()
        {
            int c; do { c = Read(); } while (c == ' ' || c == '\t' || c == '\r' || c == '\n');
            int sign = 1; if (c == '-'){ sign = -1; c = Read(); }
            long n = 0; while (c >= '0' && c <= '9'){ n = n * 10 + c - '0'; c = Read(); }
            return n*sign;
        }
        public int[] ReadIntList()
        {
            var n = ReadInt();
            var a = new int[n];
            for (int i = 0; i < n; i++) a[i] = ReadInt();
            return a;
        }
    }

    internal class Cout : StreamWriter
    {
        public Cout() : base(Console.OpenStandardOutput(65536), Encoding.ASCII){}
    }

    internal static class Ext
    {
        public static void WriteList<T>(this TextWriter sw, IEnumerable<T> src)
        {
            using (var en = src.GetEnumerator())
                if (en.MoveNext()) { sw.Write("{0}", en.Current);
                while (en.MoveNext()) sw.Write(" {0}", en.Current); }
            sw.WriteLine();
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Globalization;

namespace Beresta
{

	class ContestIO : StreamWriter
	{
		public ContestIO(Stream streamIn, Stream streamOut) : base(streamOut, Encoding.ASCII, 8192) { Reader = new StreamReader(streamIn, Encoding.ASCII, false, 8192); }
		public ContestIO(string inputFilePath, string outputFilePath) : this(File.OpenRead(inputFilePath), File.OpenWrite(outputFilePath)) { }
		public ContestIO(string inputText) : this(new MemoryStream(Encoding.ASCII.GetBytes(inputText)), Console.OpenStandardOutput(8192)) { }
		public ContestIO() : this(Console.OpenStandardInput(8192), Console.OpenStandardOutput(8192)) { }
		//d.ToString("N12", CultureInfo.InvariantCulture).Replace(",", "")
		public StreamReader Reader;

		bool IsDigit(int c) { return c >= '0' && c <= '9'; }
		public long Read()
		{
			int c1 = 0, c;
			while (!IsDigit(c = Reader.Read())) { c1 = c; }
			long r = c - '0';
			while (IsDigit(c = Reader.Read()))
				r = r * 10 + c - '0';
			return c1 == '-' ? -r : r;
		}
		public long[] ReadArray(int size) { return Enumerable.Range(0, size).Select(v => Read()).ToArray(); }
	}

	class Program
	{

		static void Main(string[] args)
		{
			using (var io = new ContestIO())
			{
				var n = io.Read();
				var t = io.Read();

				if(t == 0) {
					io.WriteLine(0);
				}
				else {
					if(n == 1) {
						io.WriteLine(1);
					}
					else {
						var arr = new long[n, n];
						//for (var i = 0; i < n; i++)
						//{
						//    for (var j = 0; j <= i; j++)
						//    {
						//        arr[i, j] = 1024;
						//    }
						//}

						var val = 2048;

						arr[0, 0] = t * val;
						var count = 0L;
						for (var i = 0; i < n; i++)
						{
							for (var j = 0; j <= i; j++)
							{
								if (arr[i, j] > val)
								{
									var delta = arr[i, j] - val;
									arr[i, j] = val;
									if (i < (n - 1))
									{
										arr[i + 1, j] += delta / 2;
										arr[i + 1, j + 1] += delta / 2;
										if (val % 2 > 0)
											throw new Exception();
									}
								}
								if (arr[i, j] == val)
									count++;
							}
						}

						io.WriteLine(count);
					}
				}

				//var s = 1L;
				//var count = 0L;
				//while (t > 0)
				//{
				//    t -= s;
				//    if (t >= 0)
				//    {
				//        count += s;
				//        s++;
				//    }
				//}

				//io.WriteLine(count);
			}

			Console.ReadLine();
		}

	}

}

using System;
using System.IO;
using System.Text;

namespace Pyramid_of_Glasses
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();
            int t = Next();

            const int m = 1024;

            var nn = new int[n + 1,n + 1];

            nn[0, 0] = t*m;

            int count = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (i + j >= n)
                        break;

                    if (nn[i, j] >= m)
                    {
                        count++;
                        int d = (nn[i, j] - m)/2;
                        nn[i + 1, j] += d;
                        nn[i, j + 1] += d;
                    }
                }
            }

            writer.WriteLine(count);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
    class Program
    {
        static StreamReader reader;
        static StreamWriter writer;
        static int CAP = 1 << 12;

        static void Main(string[] args)
        {
            //#if DEBUG
            reader = new StreamReader(Console.OpenStandardInput(32768), Encoding.ASCII, false, 32768);
            writer = new StreamWriter(Console.OpenStandardOutput(32768), Encoding.ASCII, 32768);
            //#else
            //            StreamReader streamReader = new StreamReader(Console.OpenStandardInput(32768), Encoding.ASCII, false, 32768);
            //            StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(32768), Encoding.ASCII, 32768);
            //#endif
            InputReader input = new InputReader(reader);

            int n = input.NextInt();
            int t = input.NextInt();
            int[,] a = new int[n, n];
            a[0, 0] = CAP * t;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j <= i; j++)
                {
                    Fill(i, j, n, a);
                }
            }
            int sum = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (a[i, j] >= CAP)
                    {
                        sum++;
                    }
                }
            }
            writer.WriteLine(sum);

#if DEBUG
                Console.BackgroundColor = ConsoleColor.White;
            Console.ForegroundColor = ConsoleColor.Black;
#endif
            writer.Close();
            reader.Close();
        }

        static void Fill(int x, int y, int n, int[,] a)
        {
            if (x + 1 >= n)
            {
                return;
            }
            if (a[x, y] > CAP)
            {
                int f = a[x, y] - CAP;
                a[x + 1, y] += f / 2;
                a[x + 1, y + 1] += f / 2;
            }
        }
    }

    class MyPair
    {
        public int x, y;

        public MyPair(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        public override string ToString()
        {
            return "[" + x + ", " + y + "]";
        }
    }

    // this class is copy
    class InputReader
    {
        private char[] _inbuf;
        private int _lenbuf = 0, _ptrbuf = 0;
        private StreamReader _reader;

        public InputReader(StreamReader reader)
        {
            _reader = reader;
            _inbuf = new char[1024];
            _lenbuf = 0;
            _ptrbuf = 0;
        }

        private int ReadByte()
        {
            if (_lenbuf == -1)
                throw new Exception();
            if (_ptrbuf >= _lenbuf)
            {
                _ptrbuf = 0;
                try
                {
                    _lenbuf = _reader.Read(_inbuf, 0, 1024);
                }
                catch (IOException e)
                {
                    throw e;
                }
                if (_lenbuf <= 0)
                    return -1;
            }
            return _inbuf[_ptrbuf++];
        }

        private bool IsSpaceChar(int c)
        {
            return !(c >= 33 && c <= 126);
        }

        private int Skip()
        {
            int b;
            while ((b = ReadByte()) != -1 && IsSpaceChar(b)) ;
            return b;
        }

        public int NextInt()
        {
            return int.Parse(this.Next());
        }

        public int[] NextIntArray(int n)
        {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = NextInt();
            }
            return a;
        }

        public long NextLong()
        {
            return long.Parse(this.Next());
        }

        public string Next()
        {
            var b = Skip();
            var sb = new StringBuilder();
            while (!(IsSpaceChar(b)))
            {
                sb.Append((char)b);
                b = ReadByte();
            }
            return sb.ToString();
        }

        public double NextDouble()
        {
            return double.Parse(Next(), CultureInfo.InvariantCulture);
        }

        internal long[] NextLongArray(long n)
        {
            long[] a = new long[(int)n];
            for (int i = 0; i < a.Length; i++)
            {
                a[i] = NextLong();
            }
            return a;
        }

        internal double[] NextDoubleArray(int n)
        {
            double[] a = new double[n];
            for (int i = 0; i < a.Length; i++)
            {
                a[i] = NextDouble();
            }
            return a;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

namespace CF317
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var sr = new InputReader(Console.In);
            //var sr = new InputReader(new StreamReader("input.txt"));
            var task = new Task();
            using (var sw = Console.Out)
                //using (var sw = new StreamWriter("output.txt"))
            {
                task.Solve(1, sr, sw);
                //Console.ReadKey();
            }
        }
    }

    internal class Task
    {
        private double[,]matrix;
        private const int max = 200;
        public void Solve(int testNumber, InputReader sr, TextWriter sw)
        {
            var input = sr.ReadArray(Int32.Parse);
            var n = input[0];
            var t = input[1];
            matrix = new double[max, max];
            var maximum = n*(n + 1)/2;
            var result = 0;
            for (var i = 0; i < t; i++)
            {
                Solution(n, 0, 100, 100.0);
                result = 0;
                for (var k = 0; k < n; k++)
                {
                    for (var j = 0; j < max; j++)
                    {
                        if (matrix[k, j] >= 100.0)
                        {
                            result++;
                        }
                    }
                }
                if (result >= maximum)
                {
                    result = maximum;
                    break;
                }
            }

            sw.WriteLine(result);
        }

        private void Solution(int n, int i, int j, double count)
        {
            if(i < 0 || i >= n)
                return;
            if(j >= max || j < 0)
                return;
            matrix[i, j] += count;
            if (matrix[i, j] > 100.0)
            {
                var diff = matrix[i, j] - 100.0;
                matrix[i, j] = 100.0;
                Solution(n, i + 1, j - 1, diff / 2.0);
                Solution(n, i + 1, j + 1, diff / 2.0);
            }

        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(NextString());
    }

    public long NextInt64()
    {
        return Int64.Parse(NextString());
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();
            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AlgoTraining.Codeforces.B_s
{
    public class FastScanner : StreamReader
    {
        private string[] _line;
        private int _iterator;

        public FastScanner(Stream stream) : base(stream)
        {
            _line = null;
            _iterator = 0;
        }
        public int NextInt()
        {
            if (_line == null || _iterator >= _line.Length)
            {
                _line = base.ReadLine().Split(' ');
                _iterator = 0;
            }
            if (_line.Count() == 0) throw new IndexOutOfRangeException("Input string is empty");
            return Convert.ToInt32(_line[_iterator++]);
        }
        public long NextLong()
        {
            if (_line == null || _iterator >= _line.Length)
            {
                _line = base.ReadLine().Split(' ');
                _iterator = 0;
            }
            if (_line.Count() == 0) throw new IndexOutOfRangeException("Input string is empty");
            return Convert.ToInt64(_line[_iterator++]);
        }
    }
    class Pyramid
    {
        public static void Main(string[] args)
        {
            using (FastScanner fs = new FastScanner(new BufferedStream(Console.OpenStandardInput())))
            using (StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())))
            {
                int n = fs.NextInt(), k = fs.NextInt();
                double[] a = new double[n * n];
                while (k > 0)
                {
                    Fill(0, 1, a, 1, n);
                    k--;
                }
                int count = 0;
                for (int i = 0; i < a.Length; i++)
                {
                    if (a[i] >= 1.0) count++;
                }
                writer.WriteLine(count);
            }
        }
        public static void Fill(int i, double val, double[] a, int level, int n)
        {
            a[i] += val;
            if (a[i] > 1)
            {
                double ex = a[i] - 1;
                a[i] = 1;
                if (level < n)
                {
                    Fill(i + level, ex / 2, a, level + 1, n);
                    Fill(i + level + 1, ex / 2, a, level + 1, n);
                }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace CFCF_354_DIV_2_B
{
    class Program
    {
        public class Node
        {
            public Node Left { get; set; }
            public Node Right { get; set; }
            public double Volume { get; set; }

            public void AddVolume(double val)
            {
                if (Volume == 1)
                {
                    if (Left != null && Right != null)
                    {
                        Left.AddVolume(val/2);
                        Right.AddVolume(val/2);
                    }
                }
                else if(Volume + val > 1)
                {
                    var diff = (Volume + val - 1);
                    Left.AddVolume(diff / 2);
                    Right.AddVolume(diff / 2);
                    Volume = 1;
                }
                else
                {
                    Volume += val;
                }
            }
        }

        static void Main(string[] args)
        {
            var input = Console.ReadLine();
            var inputParts = input.Split(' ');
            var n = Convert.ToInt32(inputParts[0]);
            var t = Convert.ToInt32(inputParts[1]);

            if (n == 0 || t == 0)
            {
                Console.WriteLine(0);
                return;
            }

            List<Node> nodes = new List<Node>();
            for (int i = 1; i <= n*n; i++)
            {
                nodes.Add(new Node());
            }

            //nodes[0].Left = nodes[1];
            //nodes[0].Right = nodes[2];
            int currentNode = 0;
            for (int i = 1; i < n; i++)
            {
                for (int j = 0; j < i; j++)
                {
                    nodes[currentNode].Left = nodes[currentNode + i];
                    nodes[currentNode].Right = nodes[currentNode + i + 1];

                    currentNode++;
                }
            }

            for (int i = 0; i < t; i++)
            {
                nodes[0].AddVolume(1);
            }

            int full = nodes.Where(node => node.Volume == 1).Count();

            Console.WriteLine(full);
            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public void Solve()
    {
        int n = ReadInt();
        int t = ReadInt();
        var a = new int[n, n];
        int m = 1 << n - 1;

        while (t-- > 0)
        {
            a[0, 0] += m;
            for (int i = 0; i + 1 < n; i++)
                for (int j = 0; j <= i; j++)
                {
                    int v = Math.Max(0, a[i, j] - m);
                    a[i, j] -= v;
                    a[i + 1, j] += v / 2;
                    a[i + 1, j + 1] += v / 2;
                }
        }

        int ans = 0;
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                if (a[i, j] >= m)
                    ans++;

        Write(ans);
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        //reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            new Solver().Solve();
            //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write
    private static Queue<string> currentLineTokens = new Queue<string>();
    private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); }
    public static string ReadToken() { while (currentLineTokens.Count == 0)currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }
    public static int ReadInt() { return int.Parse(ReadToken()); }
    public static long ReadLong() { return long.Parse(ReadToken()); }
    public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }
    public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }
    public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }
    public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }
    public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++)matrix[i] = ReadIntArray(); return matrix; }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++)ret[i][j] = matrix[j][i]; } return ret;
    }
    public static string[] ReadLines(int quantity) { string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++)lines[i] = reader.ReadLine().Trim(); return lines; }
    public static void WriteArray<T>(IEnumerable<T> array) { writer.WriteLine(string.Join(" ", array)); }
    public static void Write(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array)writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++)ret[i] = new T(); return ret; }
    #endregion
}

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

namespace CodeForces
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			int[] nums = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();
			int n = nums [0];
			int t = nums [1];
			double[,] triangle = new double[n, n];
			for (int k = 0; k < t; k++) {
				triangle [0, 0] += 1;
				for (int col = 0; col < n - 1; col++) {
					for (int row = 0; row <= col; row++) {
						if (triangle [col, row] > 1) {
							double diff = triangle [col, row] - 1;
							triangle [col, row] = 1;
							triangle [col + 1, row] += diff / 2;
							triangle [col + 1, row + 1] += diff / 2;
						}
					}
				}
			}
			int count = 0;
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if (triangle [i, j] >= 1)
						count++;
				}
			}
			Console.WriteLine (count);
		}
	}
}

using System;
using System.Linq;
using System.Collections.Generic;

namespace CodeForces
{
	class Program
	{
#if !ONLINE_JUDGE
		static Queue<string> testInput = new Queue<string>(new List<string>()
		{
			"10 10000",
		});
#endif

		public static long c(long N, long K, Func<long, long, long> rec)
		{
			long r = 1;
			long d;
			if (K > N) return 0;
			for (d = 1; d <= K; d++)
			{
				r *= N--;
				r /= d;
			}
			return r;
		}

		static string Solve()
		{
			checked
			{
				long n, t;
				read(out n, out t);

				double[][] s = new double[n][];
				for (int i = 0; i < n; i++)
				{
					s[i] = new double[i + 1];
					//s[i][0] = (1L << (i + 1)) - 1;
					//s[i][i] = (1L << (i + 1)) - 1;
					//for (int j = 1; j < i; j++)
					//{
					//	double o = 1.0 / (1 << (i - 1));
					//	double fa = c(i - 1, j - 1) * o;
					//	double fb = c(i - 1, j) * o;
					//	s[i][j] = (long)Math.Round((s[i - 1][j - 1] * fa + s[i - 1][j] * fb + 2) / (fa + fb));
					//}
				}

				var a = DP<long, long, long>(c);

				for (int tt = 0; tt < t; tt++)
				{
					s[0][0] += 1.0;
					for (int i = 0; i < n; i++)
					{
						for (int j = 0; j <= i; j++)
						{
							double diff = s[i][j] - 1;
							if (diff > 0)
							{
								s[i][j] = 1;
								if (i + 1 == n) continue;
								s[i + 1][j] += diff / 2;
								s[i + 1][j + 1] += diff / 2;
							}
						}
					}
				}

				return s.SelectMany(x => x).Count(x => x == 1).ToString();

			}
		}

		// Everything after this comment is template code

		static void Main(string[] args)
		{
#if !ONLINE_JUDGE
			var sw = new System.Diagnostics.Stopwatch();
			sw.Start();
#endif
			string s = Solve();
			if (!string.IsNullOrEmpty(s))
			{
				Console.WriteLine(s);
			}
#if !ONLINE_JUDGE
			sw.Stop();
			Console.WriteLine(sw.Elapsed);
			Console.ReadKey();
#endif
		}

		private static T read<T>()
		{
			return (T)Convert.ChangeType(read(), typeof(T));
		}

		private static string read()
		{
#if ONLINE_JUDGE
			return Console.ReadLine();
#else
			return testInput.Dequeue();
#endif
		}

		private static T[] readMany<T>()
		{
			return readMany<T>(' ');
		}

		private static _[] readMany<_>(params char[] ___)
		{
			return read().Split(___).Select(__ => (_)Convert.ChangeType(__, typeof(_))).ToArray();
		}

		private static string[] readMany()
		{
			return readMany<string>();
		}

		private static T[][] readField<T>(int height, Func<char, T> map)
		{
			T[][] res = new T[height][];
			for (int _ = 0; _ < height; _++)
			{
				res[_] = read().Select(c => map(c)).ToArray();
			}
			return res;
		}

		private static char[][] readField(int height)
		{
			return readField(height, c => c);
		}

		private static T[][] readField<T>(int height, Dictionary<char, T> dic)
		{
			return readField(height, c => dic[c]);
		}

		private static void read<T1>(out T1 t1)
		{
			var vals = readMany();
			t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
		}

		private static void read<T1, T2>(out T1 t1, out T2 t2)
		{
			var vals = readMany();
			t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
			t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));
		}

		private static void read<T1, T2, T3>(out T1 t1, out T2 t2, out T3 t3)
		{
			var vals = readMany();
			t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
			t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));
			t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));
		}

		private static void read<T1, T2, T3, T4>(out T1 t1, out T2 t2, out T3 t3, out T4 t4)
		{
			var vals = readMany();
			t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
			t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));
			t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));
			t4 = (T4)Convert.ChangeType(vals[3], typeof(T4));
		}

		private static void read<T1, T2, T3, T4, T5>(out T1 t1, out T2 t2, out T3 t3, out T4 t4, out T5 t5)
		{
			var vals = readMany();
			t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));
			t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));
			t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));
			t4 = (T4)Convert.ChangeType(vals[3], typeof(T4));
			t5 = (T5)Convert.ChangeType(vals[4], typeof(T5));
		}

		static Func<T1, TResult> DP<T1, TResult>(Func<T1, TResult> f)
		{
			var cache = new Dictionary<Tuple<T1>, TResult>();
			return (t1) =>
			{
				var key = Tuple.Create(t1);
				if (!cache.ContainsKey(key))
					cache.Add(key, f(t1));
				return cache[key];
			};
		}

		static Func<T1, TResult> DP<T1, TResult>(Func<T1, Func<T1, TResult>, TResult> f)
		{
			var cache = new Dictionary<Tuple<T1>, TResult>();
			Func<T1, TResult> res = null;
			res = (t1) =>
			{
				var key = Tuple.Create(t1);
				if (!cache.ContainsKey(key))
					cache.Add(key, f(t1, res));
				return cache[key];
			};
			return res;
		}

		static Func<T1, T2, TResult> DP<T1, T2, TResult>(Func<T1, T2, Func<T1, T2, TResult>, TResult> f)
		{
			var cache = new Dictionary<Tuple<T1, T2>, TResult>();
			Func<T1, T2, TResult> res = null;
			res = (t1, t2) =>
			{
				var key = Tuple.Create(t1, t2);
				if (!cache.ContainsKey(key))
					cache.Add(key, f(t1, t2, res));
				return cache[key];
			};
			return res;
		}

		static Func<T1, T2, T3, TResult> DP<T1, T2, T3, TResult>(Func<T1, T2, T3, Func<T1, T2, T3, TResult>, TResult> f)
		{
			var cache = new Dictionary<Tuple<T1, T2, T3>, TResult>();
			Func<T1, T2, T3, TResult> res = null;
			res = (t1, t2, t3) =>
			{
				var key = Tuple.Create(t1, t2, t3);
				if (!cache.ContainsKey(key))
					cache.Add(key, f(t1, t2, t3, res));
				return cache[key];
			};
			return res;
		}

		static Func<T1, T2, T3, T4, TResult> DP<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, Func<T1, T2, T3, T4, TResult>, TResult> f)
		{
			var cache = new Dictionary<Tuple<T1, T2, T3, T4>, TResult>();
			Func<T1, T2, T3, T4, TResult> res = null;
			res = (t1, t2, t3, t4) =>
			{
				var key = Tuple.Create(t1, t2, t3, t4);
				if (!cache.ContainsKey(key))
					cache.Add(key, f(t1, t2, t3, t4, res));
				return cache[key];
			};
			return res;
		}

		static IEnumerable<long> range(long first, long last, long step = 1)
		{
			for (long i = first; i <= last; i += step)
			{
				yield return i;
			}
		}

		static IEnumerable<int> range(int first, int last, int step = 1)
		{
			for (int i = first; i <= last; i += step)
			{
				yield return i;
			}
		}
	}

	public static class ExtensionMethods
	{
		public static IEnumerable<TOut> Cartesian<T1, T2, TOut>(this IEnumerable<T1> first, IEnumerable<T2> second, Func<T1, T2, TOut> collector)
		{
			return first.SelectMany(f => second.Select(s => collector(f, s)));
		}

		public static IEnumerable<Tuple<T1, T2>> Cartesian<T1, T2>(this IEnumerable<T1> first, IEnumerable<T2> second)
		{
			return first.Cartesian(second, Tuple.Create);
		}

		public static IEnumerable<Tuple<T1, T2, T3>> Cartesian<T1, T2, T3>(this IEnumerable<Tuple<T1, T2>> first, IEnumerable<T3> second)
		{
			return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, y));
		}

		public static IEnumerable<Tuple<T1, T2, T3, T4>> Cartesian<T1, T2, T3, T4>(this IEnumerable<Tuple<T1, T2, T3>> first, IEnumerable<T4> second)
		{
			return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, y));
		}

		public static IEnumerable<Tuple<T1, T2, T3, T4, T5>> Cartesian<T1, T2, T3, T4, T5>(this IEnumerable<Tuple<T1, T2, T3, T4>> first, IEnumerable<T5> second)
		{
			return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, x.Item4, y));
		}

		public static IEnumerable<IEnumerable<T>> Cartesian<T>(this IEnumerable<IEnumerable<T>> source)
		{
			IEnumerable<IEnumerable<T>> res = source.First().Select(x => single(x));
			foreach (IEnumerable<T> next in source.Skip(1))
			{
				res = res.Cartesian(next, (sofar, n) => sofar.Concat(single(n)));
			}
			return res;
		}

		public static IEnumerable<IEnumerable<T>> Pow<T>(this IEnumerable<T> it, int num)
		{
			return Enumerable.Repeat(it, num).Cartesian();
		}

		public static IEnumerable<T> Demask<T>(this IEnumerable<Tuple<T, bool>> inp)
		{
			foreach (var pair in inp)
			{
				if (pair.Item2)
				{
					yield return pair.Item1;
				}
			}
		}

		public static IEnumerable<IEnumerable<T>> Combinations<T>(this IEnumerable<T> it)
		{
			foreach (var conf in new[] { true, false }.Pow(it.Count()))
			{
				yield return it.Zip(conf, Tuple.Create).Demask();
			}
		}

		private static IEnumerable<T> single<T>(T it)
		{
			yield return it;
		}

		private static IEnumerable<T> ExceptSingle<T>(this IEnumerable<T> first, T it, IEqualityComparer<T> comp = null)
		{
			comp = comp ?? EqualityComparer<T>.Default;
			bool seen = false;
			foreach (T a in first)
			{
				if (!seen && comp.Equals(a, it))
				{
					seen = true;
				}
				else
				{
					yield return a;
				}
			}
		}

		public static IEnumerable<IEnumerable<T>> Permutations<T>(this IEnumerable<T> it)
		{
			if (it.Count() < 2)
			{
				yield return it;
				yield break;
			}

			foreach (T first in it)
			{
				foreach (IEnumerable<T> part in Permutations(it.ExceptSingle(first)))
				{
					yield return single(first).Concat(part);
				}
			}
		}
	}
}

using System;
using System.Linq;

namespace TopCoder.Test.CodeForces.Batch676
{
    public class Program676B
    {
        public static void Main(string[] args)
        {
            int[] t = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
            int n = t[0];
            int m = t[1];

            int result = Simulate(n, m);

            Console.WriteLine(result);
        }

        public static int Simulate(int n, int t)
        {
            double[,] g = new double[n, n];

            for (int q = 0; q < t; q++)
            {
                g[0, 0] += 1;

                for (int i = 0; i < n; i++)
                    for (int j = 0; j <= i; j++)
                        if (g[i, j] > 1 && i < n - 1)
                        {
                            double d = g[i, j] - 1;
                            g[i, j] -= d;
                            g[i + 1, j] += d / 2;
                            g[i + 1, j + 1] += d / 2;
                        }
            }

            int count = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j <= i; j++)
                    if (g[i, j] >= 1) ++count;

            return count;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;

namespace codeforces
{
	class Program
	{
		public const int Osn = 1000000007;

		public class Pair
		{
			public long First;

			public long Second;
		}

/*		public class PairComparer : IComparer<Pair>
		{
			public int Compare(Pair x, Pair y)
			{
				if (x.First > y.First || (x.First == y.First && x.Second < y.Second))
					return -1;
				return 1;
			}
		}*/

		public static long GetGcd(long a, long b)
		{
			while (true)
			{
				if (b == 0)
					return a;
				var a1 = a;
				a = b;
				b = a1 % b;
			}
		}

		public static void WriteYesNo(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string ReadString()
		{
			return Console.ReadLine();
		}

		public static List<int> ReadListOfInts()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static List<long> ReadListOfLongs()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(long.Parse).ToList();
		}

		public static int ReadInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static long ReadLong()
		{
			var s = Console.ReadLine();
			return long.Parse(s);
		}

		public class Vertex
		{
			public int Was;

			public List<int> Edges;
		}

		public static List<Vertex> Graph = new List<Vertex>();

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		public static int BinarySearch(List<int> list, int value)
		{
			var l = -1;
			var r = list.Count;
			while (r - l > 1)
			{
				var m = (r + l) / 2;
				if (list[m] >= value)
					r = m;
				else
					l = m;
			}

			return r;
		}

		private static void Main()
		{
			var l = ReadListOfInts();
			var n = l[0];
			var t = l[1];
			var ans = new List<decimal>();
			var ct = n * (n + 1) / 2;
			for (var i = 0; i <= ct; ++i)
				ans.Add(0);
			ans[1] = t;
			var num = 0;
			for (var i = 1; i <= n; ++i)
			{
				for (var j = 1; j <= i; ++j)
				{
					num += 1;
					if (ans[num] > 1)
					{
						var x = (ans[num] - 1) / 2;
						ans[num] = 1;
						var ll = (i * (i + 1)) / 2 + j;
						var rr = (i * (i + 1)) / 2 + j + 1;
						if (ll <= ct)
							ans[ll] += x;
						if (rr <= ct)
							ans[rr] += x;
					}
				}
			}
			Console.WriteLine(ans.Count(x => x == 1));
			Console.ReadLine();
		}
	}
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
using System.Globalization;

class Program2
{
    private static void Push(int x, int y, double flow)
    {
        if (y >= n) return;

        p[x, y] += flow;
        if (p[x, y] > 1)
        {
            double next = p[x, y] - 1;
            p[x, y] = 1;

            Push(x, y + 1, next / 2);
            Push(x + 1, y + 1, next / 2);
        }
    }

    private static double[,] p = new double[11, 11];
    private static int n;
    static void Main(string[] args)
    {
        n = ReadInt();
        int t = ReadInt();

        while (t > 0)
        {
            Push(0, 0, 1);
            t--;
        }

        int count = 0;
        for (int i = 0; i <= n; i++)
            for (int j = 0; j <= n; j++)
                if (p[i, j] >= 1 - 1e-8)
                {
                    count++;
                }
        Console.Write(count);
    }

    private static List<int>[] ReadGraph(int n, int m)
    {
        List<int>[] g = new List<int>[n];
        for (int i = 0; i < n; i++) g[i] = new List<int>();
        for (int i = 0; i < m; i++)
        {
            int a = ReadInt() - 1;
            int b = ReadInt() - 1;

            g[a].Add(b);
        }

        return g;
    }

    private static int[,] ReadGraphAsMatrix(int n, int m)
    {
        int[,] matrix = new int[n + 1, n + 1];
        for (int i = 0; i < m; i++)
        {
            int a = ReadInt();
            int b = ReadInt();
            matrix[a, b] = matrix[b, a] = 1;
        }

        return matrix;
    }

    private static void Sort(ref int a, ref int b)
    {
        if (a > b) Swap(ref a, ref b);
    }

    private static void Swap(ref int a, ref int b)
    {
        int tmp = a;
        a = b;
        b = tmp;
    }

    private const int BufferSize = 1 << 16;
    private static StreamReader consoleReader;
    private static MemoryStream testData;

    private static int ReadInt()
    {
        int ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static ulong ReadULong()
    {
        ulong ans = 0;
        int chr;
        do
        {
            chr = consoleReader.Read();
            if (chr == -1)
                return 0;
        } while (chr < '0' || chr > '9');

        ans = (uint)(chr - '0');
        while (true)
        {
            chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans;
            ans = ans * 10 + (uint)(chr - '0');
        }
    }

    private static long ReadLong()
    {
        long ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static int[] ReadIntArray(int n)
    {
        int[] ans = new int[n];
        for (int i = 0; i < n; i++)
            ans[i] = ReadInt();
        return ans;
    }

    private static long[] ReadLongArray(int n)
    {
        long[] ans = new long[n];
        for (int i = 0; i < n; i++)
            ans[i] = ReadLong();
        return ans;
    }

    private static char[] ReadString()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        List<char> s = new List<char>();
        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s.ToArray();
    }

    private static char[] ReadString(int n)
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        char[] s = new char[n];
        int pos = 0;
        do
        {
            s[pos++] = (char)ans;
            if (pos == n) break;
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s;
    }

    private static char ReadLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'))
                return (char)ans;
        }
    }

    private static char ReadDigit()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (ans >= '0' && ans <= '9')
                return (char)ans;
        }
    }

    private static int ReadDigitInt()
    {
        return ReadDigit() - (int)'0';
    }

    private static char ReadAnyChar()
    {
        return (char)consoleReader.Read();
    }

    private static string DoubleToString(double x)
    {
        return x.ToString(CultureInfo.InvariantCulture);
    }

    static Program2()
    {
        //System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);
    }

    private static void PushTestData(string data)
    {
#if !ONLINE_JUDGE
        if (testData == null)
        {
            testData = new MemoryStream();
            consoleReader = new StreamReader(testData);
        }

        var pos = testData.Position;
        var bytes = Encoding.UTF8.GetBytes(data);
        testData.Write(bytes, 0, bytes.Length);
        testData.Flush();
        testData.Position = pos;
#endif
    }
}

using System;

namespace PyramidOfGlasses
{
    partial class PyramidOfGlasses
    {
        static void Main(string[] args)
        {
            int n, initT, t, fillAll;
            int left, right;
            int answer = 0;

            n = NextInt();
            t = NextInt();
            initT = t;

            int[][] tree = new int[n][];
            int[][] minTree = new int[n][];

            for (int i = 0; i < n; i++)
            {
                tree[i] = new int[i + 1];
                minTree[i] = new int[i + 1];

                for (int j = 0, k = tree[i].Length - 1, level = (int)Math.Pow(2, i); j <= k; j++, k--, level /= 2)
                {
                    tree[i][j] = tree[i][k] = level;
                }
            }

            minTree[0][0] = 1;

            for (int i = 1; i < n; i++)
            {
                for (int j = 0; j < minTree[i].Length; j++)
                {
                    left = j == 0 ? int.MaxValue : minTree[i - 1][j - 1];
                    right = j == minTree[i].Length - 1 ? int.MaxValue : minTree[i - 1][j];

                    minTree[i][j] = tree[i][j] + Math.Min(left, right);
                }
            }

            for (int i = 0; i < n; i++)
            {
                fillAll = (int)Math.Pow(2, i);

                if (t >= fillAll)
                {
                    answer += (i + 1);
                    t -= fillAll;
                }
                else
                {
                    for (int j = 0; j < minTree[i].Length; j++)
                    {
                        if (minTree[i][j] <= initT)
                            answer++;
                    }

                    break;
                }
            }

            Console.WriteLine(answer);
        }
    }

    partial class PyramidOfGlasses
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }
}

using System;

namespace PyramidOfGlasses
{
    partial class PyramidOfGlasses
    {
        static void Main(string[] args)
        {
            int n, t, level = 0;
            int glasses, fillAll, fillMiddle;
            int answer = 0;

            n = NextInt();
            t = NextInt();

            while (level < n)
            {
                if (t <= 0)
                    break;

                glasses = level + 1;
                fillAll = (int)Math.Pow(2, level);

                if (t >= fillAll)
                {
                    t -= fillAll;
                    answer += glasses;
                }
                else if (level >= 2)
                {
                    fillMiddle = fillAll / 2;

                    if (t >= fillMiddle)
                    {
                        t -= fillMiddle;
                        answer += (glasses - 2);
                    }

                    break;
                }

                level++;
            }

            Console.WriteLine(answer);
        }
    }

    partial class PyramidOfGlasses
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }
}

using System;

namespace PyramidOfGlasses
{
    partial class PyramidOfGlasses
    {
        static void Main(string[] args)
        {
            int n, initT, t, fillAll;
            int left, right;
            int answer = 0;

            n = NextInt();
            t = NextInt();
            initT = t;

            int[][] tree = new int[n][];
            int[][] minTree = new int[n][];

            for (int i = 0; i < n; i++)
            {
                tree[i] = new int[i + 1];
                minTree[i] = new int[i + 1];

                for (int j = 0, k = tree[i].Length - 1, level = (int)Math.Pow(2, i); j <= k; j++, k--, level /= 2)
                {
                    tree[i][j] = tree[i][k] = level;
                }
            }

            minTree[0][0] = 1;

            for (int i = 1; i < n; i++)
            {
                for (int j = 0; j < minTree[i].Length; j++)
                {
                    left = j == 0 ? int.MaxValue : minTree[i - 1][j - 1];
                    right = j == minTree[i].Length - 1 ? int.MaxValue : minTree[i - 1][j];

                    minTree[i][j] = tree[i][j] + Math.Min(left, right);
                }
            }

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < minTree[i].Length; j++)
                {
                    if (minTree[i][j] <= initT)
                        answer++;
                }
            }

            Console.WriteLine(answer);
        }
    }

    partial class PyramidOfGlasses
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace TaskB
{
    class Program
    {
        static void Main(string[] args)
        {
            new Solver().Solve().OutputResult();
        }

        private class ExtendedReader : StreamReader
        {
            private static readonly char Separator = ' ';

            public ExtendedReader(Stream stream) : base(stream) { }
            public ExtendedReader(Stream stream, bool detectEncodingFromByteOrderMarks) : base(stream, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(Stream stream, Encoding encoding) : base(stream, encoding) { }
            public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(stream, encoding, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }
            public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize, bool leaveOpen) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize, leaveOpen) { }
            public ExtendedReader(string path) : base(path) { }
            public ExtendedReader(string path, bool detectEncodingFromByteOrderMarks) : base(path, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(string path, Encoding encoding) : base(path, encoding) { }
            public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(path, encoding, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(path, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }

            public char ReadChar()
            {
                return (char)this.Read();
            }

            public double ReadDoubleFromArray()
            {
                StringBuilder sb = new StringBuilder();
                char ch = this.ReadChar();
                while (ch != Separator && ch != '\n')
                {
                    sb.Append(ch);
                    ch = this.ReadChar();
                }
                return Convert.ToDouble(sb.ToString());
            }

            public int ReadInt()
            {
                return int.Parse(this.ReadLine());
            }

            public Int64 ReadInt64()
            {
                return Int64.Parse(this.ReadLine());
            }

            public int[] ReadIntArray()
            {
                return this.ReadLine().Split(' ').Select(int.Parse).ToArray();
            }

            public char[] ReadCharArray()
            {
                return this.ReadLine().ToCharArray();
            }

            public string ReadString()
            {
                return this.ReadLine();
            }

            public Int64[] ReadInt64Array()
            {
                return this.ReadLine().Split(Separator).Select(Int64.Parse).ToArray();
            }

            public Double[] ReadDoubleArray()
            {
                return this.ReadLine().Split(Separator).Select(Double.Parse).ToArray();
            }
        }

        private abstract class SolverBase
        {
            protected readonly ExtendedReader _reader;
            protected readonly TextWriter _writer;

            protected SolverBase()
            {
#if DEBUG
                _reader = new ExtendedReader(@"input.txt");
                //_writer = new StreamWriter(@"output.txt");
                _writer = new StreamWriter(Console.OpenStandardOutput());
#else
                _reader = new ExtendedReader(Console.OpenStandardInput());
                _writer = new StreamWriter(Console.OpenStandardOutput());
#endif
            }

            public abstract Solver Solve();

            public abstract void OutputResult();
        }

        private class Solver : SolverBase
        {
            private int result = 0;

            public override Solver Solve()
            {
                // link to task: http://codeforces.com/contest//problem/B

                var input = _reader.ReadIntArray();
                int height = input[0];
                int time = input[1];
                var glasses = new double[Enumerable.Range(1, height).Sum()];

                for (; time >= 0; time --)
                {
                    var fillResult = FillGlasses(glasses, 0, 0);
                    if (!fillResult) break;
                }

                result = glasses.Count(x => x >= 1);

                return this;
            }

            private bool FillGlasses(double[] glasses, int index, int level)
            {
                if (glasses.Length > index)
                {
                    if (glasses[index] < 1.0)
                    {
                        glasses[index] += 1.0/Math.Pow(2, level);
                        return true;
                    }

                    var r1 = FillGlasses(glasses, index + level + 1, level + 1);
                    var r2 = FillGlasses(glasses, index + level + 2, level + 1);

                    return r1 || r2;
                }

                return false;
            }

            public override void OutputResult()
            {
                string answer = result.ToString();

                _writer.WriteLine(answer);
                _writer.Dispose();
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace TaskB
{
    class Program
    {
        static void Main(string[] args)
        {
            new Solver().Solve().OutputResult();
        }

        private class ExtendedReader : StreamReader
        {
            private static readonly char Separator = ' ';

            public ExtendedReader(Stream stream) : base(stream) { }
            public ExtendedReader(Stream stream, bool detectEncodingFromByteOrderMarks) : base(stream, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(Stream stream, Encoding encoding) : base(stream, encoding) { }
            public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(stream, encoding, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }
            public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize, bool leaveOpen) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize, leaveOpen) { }
            public ExtendedReader(string path) : base(path) { }
            public ExtendedReader(string path, bool detectEncodingFromByteOrderMarks) : base(path, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(string path, Encoding encoding) : base(path, encoding) { }
            public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(path, encoding, detectEncodingFromByteOrderMarks) { }
            public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(path, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }

            public char ReadChar()
            {
                return (char)this.Read();
            }

            public double ReadDoubleFromArray()
            {
                StringBuilder sb = new StringBuilder();
                char ch = this.ReadChar();
                while (ch != Separator && ch != '\n')
                {
                    sb.Append(ch);
                    ch = this.ReadChar();
                }
                return Convert.ToDouble(sb.ToString());
            }

            public int ReadInt()
            {
                return int.Parse(this.ReadLine());
            }

            public Int64 ReadInt64()
            {
                return Int64.Parse(this.ReadLine());
            }

            public int[] ReadIntArray()
            {
                return this.ReadLine().Split(' ').Select(int.Parse).ToArray();
            }

            public char[] ReadCharArray()
            {
                return this.ReadLine().ToCharArray();
            }

            public string ReadString()
            {
                return this.ReadLine();
            }

            public Int64[] ReadInt64Array()
            {
                return this.ReadLine().Split(Separator).Select(Int64.Parse).ToArray();
            }

            public Double[] ReadDoubleArray()
            {
                return this.ReadLine().Split(Separator).Select(Double.Parse).ToArray();
            }
        }

        private abstract class SolverBase
        {
            protected readonly ExtendedReader _reader;
            protected readonly TextWriter _writer;

            protected SolverBase()
            {
#if DEBUG
                _reader = new ExtendedReader(@"input.txt");
                //_writer = new StreamWriter(@"output.txt");
                _writer = new StreamWriter(Console.OpenStandardOutput());
#else
                _reader = new ExtendedReader(Console.OpenStandardInput());
                _writer = new StreamWriter(Console.OpenStandardOutput());
#endif
            }

            public abstract Solver Solve();

            public abstract void OutputResult();
        }

        private class Solver : SolverBase
        {
            private int result = 0;

            public override Solver Solve()
            {
                // link to task: http://codeforces.com/contest//problem/B

                var input = _reader.ReadIntArray();
                int height = input[0];
                int time = input[1];

                int level = 1;
                while (time > 0)
                {
                    time -= level;
                    if (time > 0)
                    {
                        result += level;
                        level ++;
                    }
                    if (level > height) break;
                }

                return this;
            }

            public override void OutputResult()
            {
                string answer = result.ToString();

                _writer.WriteLine(answer);
                _writer.Dispose();
            }
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Pyramid_of_Glasses
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();
            int t = Next();

            var nn = new int[n,n];
            int d = 1;
            nn[0, 0] = 1;
            for (int i = 1; i < n; i++)
            {
                d *= 2;
                nn[0, i] = nn[0, i - 1] + d;
            }

            d = 1;
            for (int i = 1; i < n; i++)
            {
                d *= 2;
                for (int j = 0; j < n; j++)
                {
                    nn[i, j] = nn[i - 1, j] + d;
                }
            }

            int count = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (i + j > n)
                        break;
                    if (nn[i, j] <= t)
                        count++;
                }
            }

            writer.WriteLine(count);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Pyramid_of_Glasses
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();
            int t = Next();

            var nn = new int[n,n];
            int d = 1;
            nn[0, 0] = 1;
            for (int i = 1; i < n; i++)
            {
                d *= 2;
                nn[0, i] = nn[0, i - 1] + d;
            }

            d = 1;
            for (int i = 1; i < n; i++)
            {
                d *= 2;
                for (int j = 0; j < n; j++)
                {
                    nn[i, j] = nn[i - 1, j] + d;
                }
            }

            int count = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (i + j >= n)
                        break;
                    if (nn[i, j] <= t)
                        count++;
                }
            }

            writer.WriteLine(count);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

namespace CF317
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var sr = new InputReader(Console.In);
            //var sr = new InputReader(new StreamReader("input.txt"));
            var task = new Task();
            using (var sw = Console.Out)
                //using (var sw = new StreamWriter("output.txt"))
            {
                task.Solve(1, sr, sw);
                //Console.ReadKey();
            }
        }
    }

    internal class Task
    {
        private double[,]matrix;
        private const int max = 200;
        public void Solve(int testNumber, InputReader sr, TextWriter sw)
        {
            var input = sr.ReadArray(Int32.Parse);
            var n = input[0];
            var t = input[1];
            matrix = new double[max, max];
            var maximum = n*(n + 1)/2;
            var result = 0;
            for (var i = 0; i < t; i++)
            {
                Solution(n, 0, 4, 100.0);
                result = 0;
                for (var k = 0; k < n; k++)
                {
                    for (var j = 0; j < max; j++)
                    {
                        if (matrix[k, j] >= 100.0)
                        {
                            result++;
                        }
                    }
                }
                if (result >= maximum)
                {
                    result = maximum;
                    break;
                }
            }

            sw.WriteLine(result);
        }

        private void Solution(int n, int i, int j, double count)
        {
            if(i < 0 || i >= n)
                return;
            if(j >= max || j < 0)
                return;
            matrix[i, j] += count;
            if (matrix[i, j] > 100.0)
            {
                var diff = matrix[i, j] - 100.0;
                matrix[i, j] = 100.0;
                Solution(n, i + 1, j - 1, diff / 2.0);
                Solution(n, i + 1, j + 1, diff / 2.0);
            }

        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(NextString());
    }

    public long NextInt64()
    {
        return Int64.Parse(NextString());
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();
            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

namespace CF317
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var sr = new InputReader(Console.In);
            //var sr = new InputReader(new StreamReader("input.txt"));
            var task = new Task();
            using (var sw = Console.Out)
                //using (var sw = new StreamWriter("output.txt"))
            {
                task.Solve(1, sr, sw);
                //Console.ReadKey();
            }
        }
    }

    internal class Task
    {
        private double[,]matrix;
        private const int max = 10;
        public void Solve(int testNumber, InputReader sr, TextWriter sw)
        {
            var input = sr.ReadArray(Int32.Parse);
            var n = input[0];
            var t = input[1];
            matrix = new double[max, max];
            var maximum = n*(n + 1)/2;
            var result = 0;
            for (var i = 0; i < t; i++)
            {
                Solution(n, 0, 4, 100.0);
                result = 0;
                for (var k = 0; k < n; k++)
                {
                    for (var j = 0; j < max; j++)
                    {
                        if (matrix[k, j] >= 100.0)
                        {
                            result++;
                        }
                    }
                }
                if (result >= maximum)
                {
                    result = maximum;
                    break;
                }
            }

            sw.WriteLine(result);
        }

        private void Solution(int n, int i, int j, double count)
        {
            if(i < 0 || i >= n)
                return;
            if(j >= max || j < 0)
                return;
            matrix[i, j] += count;
            if (matrix[i, j] > 100.0)
            {
                var diff = matrix[i, j] - 100.0;
                matrix[i, j] = 100.0;
                Solution(n, i + 1, j - 1, diff / 2.0);
                Solution(n, i + 1, j + 1, diff / 2.0);
            }

        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(NextString());
    }

    public long NextInt64()
    {
        return Int64.Parse(NextString());
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();
            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

namespace CF317
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var sr = new InputReader(Console.In);
            //var sr = new InputReader(new StreamReader("input.txt"));
            var task = new Task();
            using (var sw = Console.Out)
                //using (var sw = new StreamWriter("output.txt"))
            {
                task.Solve(1, sr, sw);
                //Console.ReadKey();
            }
        }
    }

    internal class Task
    {
        private double[,]matrix;
        private const int max = 10;
        public void Solve(int testNumber, InputReader sr, TextWriter sw)
        {
            var input = sr.ReadArray(Int32.Parse);
            var n = input[0];
            var t = input[1];
            matrix = new double[max, max];
            var maximum = n*(n + 1)/2;
            var result = 0;
            for (var i = 0; i < t; i++)
            {
                result = Solution(0, 4, 100.0);
                if (result >= maximum)
                {
                    break;
                }
            }
            result = 0;
            for (var i = 0; i < n; i++)
            {
                for (var j = 0; j < max; j++)
                {
                    if (matrix[i, j] >= 100.0)
                    {
                        result++;
                    }
                }
            }

            sw.WriteLine(result);
        }

        private int Solution(int i, int j, double count)
        {
            if(i < 0 || i >= max)
                return 0;
            if(j >= max || j < 0)
                return 0;
            matrix[i, j] += count;
            if (matrix[i, j] > 100.0)
            {
                var result = 1;
                result += Solution(i + 1, j - 1, count / 2.0);
                result += Solution(i + 1, j + 1, count / 2.0);
                return result;
            }
            else
            {
                if (Math.Abs(matrix[i, j] - 100.0) <= 0.000001)
                {
                    return 1;
                }
            }

            return 0;

        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(NextString());
    }

    public long NextInt64()
    {
        return Int64.Parse(NextString());
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();
            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}