 class Program
    {
        static void Main(string[] args)
        {
            string input;
            input = Console.ReadLine();
            String[] s = input.Split(':');
            int year = int.Parse(s[0]);
            int month = int.Parse(s[1]);
            int day = int.Parse(s[2]);
            DateTime start = new DateTime(year, month, day);
            input = Console.ReadLine();
            s = new String[3];
            s = input.Split(':');
            year = int.Parse(s[0]);
            month = int.Parse(s[1]);
            day = int.Parse(s[2]);
            DateTime enddate = new DateTime(year, month, day);
            TimeSpan result = enddate.Subtract(start);
            Console.WriteLine(Math.Abs(result.Days));
        }
    }


using System;
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split(':');
            int x1 = Convert.ToInt32(tok1[0])
            int y1 = Convert.ToInt32(tok1[1])
            int z1 = Convert.ToInt32(tok1[2]);
            line = Console.ReadLine().Split(':');
            int x2 = Convert.ToInt32(tok1[0])
            int y2 = Convert.ToInt32(tok1[1])
            int z2 = Convert.ToInt32(tok1[2]);
            DateTime first = new DateTime(x1,y1,z1);
            DateTime second = new DateTime(x2,y2,z2);
            Console.WriteLine(Math.Abs((first-second).Days));
        }
    }


using System;
using System.Linq;
using CompLib.Collections;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        var n = sc.Next().Reverse().ToArray();

        // 先頭0以外
        // 下2桁 00 25 50 75

        int ans = int.MaxValue;

        // 先頭
        for (int i = 0; i < n.Length; i++)
        {
            if (n[i] == '0') continue;
            // 2桁目
            for (int j = 0; j < n.Length; j++)
            {
                if (i == j) continue;
                for (int k = 0; k < n.Length; k++)
                {
                    if (i == k || j == k) continue;

                    bool zero = n[j] == '0' && n[k] == '0';
                    bool twentyfive = n[j] == '2' && n[k] == '5';
                    bool fifty = n[j] == '5' && n[k] == '0';
                    bool seventyfive = n[j] == '7' && n[k] == '5';
                    if (!zero && !twentyfive && !fifty && !seventyfive) continue;
                    var array = new int[n.Length];
                    for (int l = 0; l < n.Length; l++)
                    {
                        if (l == i) array[l] = 0;
                        else if (l == j) array[l] = 2;
                        else if (l == k) array[l] = 3;
                        else array[l] = 1;
                    }
                    int tmp = 0;
                    var bit = new FenwickTree(4);
                    for (int l = 0; l < n.Length; l++)
                    {
                        tmp += bit.Sum(array[l]);
                        bit.Add(array[l], 1);
                    }
                    ans = Math.Min(ans, tmp);
                }
            }
        }
        if (ans == int.MaxValue) Console.WriteLine("-1");
        else Console.WriteLine(ans);
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Collections
{
    using Num = System.Int32;

    public class FenwickTree
    {
        private readonly Num[] _array;
        public readonly int Count;

        public FenwickTree(int size)
        {
            _array = new Num[size + 1];
            Count = size;
        }

        /// <summary>
        /// A[i]にnを加算
        /// </summary>
        /// <param name="i"></param>
        /// <param name="n"></param>
        public void Add(int i, Num n)
        {
            i++;
            for (; i <= Count; i += i & -i)
            {
                _array[i] += n;
            }
        }

        /// <summary>
        /// [0,r)の和を求める
        /// </summary>
        /// <param name="r"></param>
        /// <returns></returns>
        public Num Sum(int r)
        {
            Num result = 0;
            for (; r > 0; r -= r & -r)
            {
                result += _array[r];
            }

            return result;
        }

        // [l,r)の和を求める
        public Num Sum(int l, int r) => Sum(r) - Sum(l);
    }
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


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

namespace Divisibility_by_25
{
    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)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

        private static int Solve(string[] args)
        {
            string s = reader.ReadLine();

            int min = Math.Min(Math.Min(Check(s, '0', '0'), Check(s, '2', '5')), Math.Min(Check(s, '5', '0'), Check(s, '7', '5')));
            if (min == int.MaxValue)
                return -1;

            return min;
        }

        private static int Check(string s, char c1, char c2)
        {
            int index = s.LastIndexOf(c2);
            if (index < 0)
                return int.MaxValue;
            int ans = s.Length - index - 1;
            int index2;
            if (c1 == c2)
                index2 = s.Substring(0, index).LastIndexOf(c1);
            else
                index2 = s.LastIndexOf(c1);

            if (index2 < 0)
                return int.MaxValue;

            if (index2 != s.Length - 1)
                ans += s.Length - index2 - 2;

            var b = new StringBuilder();
            for (int i = 0; i < s.Length; i++)
            {
                if (i == index || i == index2)
                    continue;
                b.Append(s[i]);
            }

            bool f = b.Length == 0;
            for (int i = 0; i < b.Length; i++)
            {
                if (b[i] != '0')
                {
                    f = true;
                    break;
                }
                ans++;
            }

            if (f)
                return ans;

            return int.MaxValue;
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29209.62
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{222A4524-A140-4F58-867E-F6E861CD2F2C}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{222A4524-A140-4F58-867E-F6E861CD2F2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{222A4524-A140-4F58-867E-F6E861CD2F2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{222A4524-A140-4F58-867E-F6E861CD2F2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{222A4524-A140-4F58-867E-F6E861CD2F2C}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {B7094F77-3830-474D-BFB8-5DE1C52FC44D}
	EndGlobalSection
EndGlobal


using System;
using System.Collections.Generic;
using System.Text;

namespace CodeForcesApp
{
    class E
    {
        #region Shortcuts
        static string RL() { return Console.ReadLine(); }
        static string[] RSA() { return RL().Split(' '); }
        static int[] RIA() { return Array.ConvertAll<string, int>(RSA(), int.Parse); }
        static int RInt() { return int.Parse(RL()); }
        static long RLong() { return long.Parse(RL()); }
        static double RDouble() { return double.Parse(RL()); }
        static void RInts2(out int p1, out int p2) { int[] a = RIA(); p1 = a[0]; p2 = a[1]; }
        static void RInts3(out int p1, out int p2, out int p3) { int[] a = RIA(); p1 = a[0]; p2 = a[1]; p3 = a[2]; }
        static void RInts4(out int p1, out int p2, out int p3, out int p4) { int[] a = RIA(); p1 = a[0]; p2 = a[1]; p3 = a[2]; p4 = a[3]; }

        static void Swap<T>(ref T a, ref T b) { T tmp = a; a = b; b = tmp; }
        static void Fill<T>(T[] d, T v) { for (int i = 0; i < d.Length; i++) d[i] = v; }
        static void Fill<T>(T[,] d, T v) { for (int i = 0; i < d.GetLength(0); i++) { for (int j = 0; j < d.GetLength(1); j++) { d[i, j] = v; } } }
        #endregion

        static void Main(string[] args)
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            //SolutionTester tester = new SolutionTester(CodeForcesTask.E);
            //tester.Test();

            Task task = new Task();
            task.Solve();
        }

        public class Task
        {
            public void Solve()
            {
                int xv, yv, xp, yp, xw1, yw1, xw2, yw2, xm1, ym1, xm2, ym2;
                RInts2(out xv, out yv);
                RInts2(out xp, out yp);
                RInts4(out xw1, out yw1, out xw2, out yw2);
                RInts4(out xm1, out ym1, out xm2, out ym2);

                Point p = new Point(xp, yp);

                Segment view = new Segment(xv, yv, xp, yp);
                Segment wall = new Segment(xw1, yw1, xw2, yw2);
                Segment mirror = new Segment(xm1, ym1, xm2, ym2);

                Point rp = p.Reflect(mirror.ToLine());

                Segment rview = new Segment(xv, yv, rp.x, rp.y);

                Point pt1, pt2;

                if (!view.Intersects(wall, out pt1, out pt2) ||
                    (rview.Intersects(mirror, out pt1, out pt2) && !rview.Intersects(wall, out pt1, out pt2)))
                    Console.WriteLine("YES");
                else
                    Console.WriteLine("NO");
            }
        }

        public class GeometryUtils
        {
            public const double EPS = 10e-8;

            public static double SqrDist(double x1, double y1, double x2, double y2)
            {
                return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
            }

            public static double Dist(double x1, double x2)
            {
                return Math.Abs(x1 - x2);
            }

            public static double Dist(double x1, double y1, double x2, double y2)
            {
                return Math.Sqrt(SqrDist(x1, y1, x2, y2));
            }

            public static double Determinant(
                double a11, double a12,
                double a21, double a22)
            {
                return a11 * a22 - a21 * a12;
            }

            public static double Determinant(
                double a11, double a12, double a13,
                double a21, double a22, double a23,
                double a31, double a32, double a33
                )
            {
                return a11 * Determinant(a22, a23, a32, a33) - a21 * Determinant(a12, a13, a32, a33) + a31 * Determinant(a12, a13, a22, a23);
            }

            public static int Sign(double val)
            {
                if (Math.Abs(val) <= EPS)
                    return 0;

                if (val > EPS)
                    return 1;

                return -1;
            }

        }

        public class Point
        {
            public double x;
            public double y;

            #region Constructors

            public Point()
            {
            }

            public Point(double _x, double _y)
            {
                x = _x;
                y = _y;
            }

            #endregion

            #region Public Methods

            public Vector ToVector()
            {
                return new Vector(x, y);
            }

            public int Orientation(Point q, Point r)
            {
                return Orientation(this, q, r);
            }

            public double Area(Point q, Point r)
            {
                return Area(this, q, r);
            }

            public double SqrDist(Point q)
            {
                return GeometryUtils.SqrDist(x, y, q.x, q.y);
            }

            public double Distance()
            {
                return GeometryUtils.Dist(x, y, 0, 0);
            }

            public double Distance(Point q)
            {
                return GeometryUtils.Dist(x, y, q.x, q.y);
            }

            public double XDist(Point q)
            {
                return GeometryUtils.Dist(x, q.x);
            }

            public double YDist(Point q)
            {
                return GeometryUtils.Dist(y, q.y);
            }

            public Point Translate(double _x, double _y)
            {
                return new Point(x + _x, y + _y);
            }

            public Point Translate(Vector v)
            {
                return new Point(x + v.x, y + v.y);
            }

            // Находит проекцию точки на прямую
            public Point Project(Line line)
            {
                Line ort = new Line(this, line.NormalVector);
                Point pt;
                line.Intersects(ort, out pt);
                return pt;
            }

            public Point Reflect(Line line)
            {
                Point pr = Project(line);
                Vector v = (pr - this).Scale(2);
                return this.Translate(v);
            }

            #endregion

            #region Static Members

            public static Vector operator -(Point p1, Point p2)
            {
                return new Vector(p1.x - p2.x, p1.y - p2.y);
            }

            public static int Orientation(Point p, Point q, Point r)
            {
                double det = GeometryUtils.Determinant(p.x, p.y, 1, q.x, q.y, 1, r.x, r.y, 1);
                if (det > 0) return 1;
                if (det < 0) return -1;
                return 0;
            }

            public static double Area(Point p, Point q, Point r)
            {
                return GeometryUtils.Determinant(q.x - p.x, q.y - p.y, r.x - p.x, r.y - p.y);
            }

            #endregion
        }

        public class Vector
        {
            public double x;
            public double y;

            public Vector()
            {
            }

            public Vector(double _x, double _y)
            {
                x = _x;
                y = _y;
            }

            public Vector Translate(double a, double b)
            {
                return new Vector(x + a, y + b);
            }

            public Vector Translate(Vector v)
            {
                return new Vector(x + v.x, y + v.y);
            }

            public Vector Scale(double d)
            {
                return new Vector(x * d, y * d);
            }
        }

        public class Segment
        {
            private Point start;
            private Point end;

            #region Constructors

            public Segment()
                : this(new Point(), new Point())
            {
            }

            public Segment(Point s, Point e)
            {
                start = s;
                end = e;
            }

            public Segment(double x1, double y1, double x2, double y2)
                : this(new Point(x1, y1), new Point(x2, y2))
            {
            }

            #endregion

            #region Public Properties

            public Point Start
            {
                get { return start; }
                set { start = value; }
            }

            public Point End
            {
                get { return end; }
                set { end = value; }
            }

            public double x1
            {
                get { return start.x; }
                set { start.x = value; }
            }

            public double y1
            {
                get { return start.y; }
                set { start.y = value; }
            }

            public double x2
            {
                get { return end.x; }
                set { end.x = value; }
            }

            public double y2
            {
                get { return end.y; }
                set { end.y = value; }
            }

            public Vector Direction
            {
                get { return End - Start; }
            }

            #endregion

            #region Public Methods

            public Line ToLine()
            {
                return new Line(this);
            }

            public bool Intersects(Segment seg, out Point p1, out Point p2)
            {
                p1 = new Point();
                p2 = new Point();

                double minx1 = Math.Min(Start.x, End.x);
                double maxx1 = Math.Max(Start.x, End.x);
                double miny1 = Math.Min(Start.y, End.y);
                double maxy1 = Math.Max(Start.y, End.y);

                double minx2 = Math.Min(seg.Start.x, seg.End.x);
                double maxx2 = Math.Max(seg.Start.x, seg.End.x);
                double miny2 = Math.Min(seg.Start.y, seg.End.y);
                double maxy2 = Math.Max(seg.Start.y, seg.End.y);

                if (minx1 > maxx2 || maxx1 < minx2 || miny1 > maxy2 || maxy1 < miny2)
                    return false;  // boundary rectangles not intersected

                Line this_line = this.ToLine();
                Line seg_line = seg.ToLine();

                if (this_line.Parallel(seg_line))
                {
                    if (this_line.Equivalent(seg_line))
                    {
                        p1.x = Math.Max(minx1, minx2);
                        p1.y = Math.Max(miny1, miny2);
                        p2.x = Math.Min(maxx1, maxx2);
                        p2.y = Math.Min(miny1, miny2);
                        return true; // intersection by segment
                    }
                    else
                        return false; // parallel
                }

                Point pt;
                if (!this_line.Intersects(seg_line, out pt))
                    return false;

                if (pt.x >= minx1 && pt.x <= maxx1 &&
                    pt.y >= miny1 && pt.y <= maxy1 &&
                    pt.x >= minx2 && pt.x <= maxx2 &&
                    pt.y >= miny2 && pt.y <= maxy2)
                {
                    p1.x = pt.x;
                    p1.y = pt.y;
                    p2.x = pt.x;
                    p2.y = pt.y;
                    return true; // in one point
                }

                return false;
            }

            public double Distance(Point p)
            {
                Line line = this.ToLine();
                double[] cc = line.Coeffs;
                double A = cc[0];
                double B = cc[1];
                double C = cc[2];

                double d = (A * p.x + B * p.y + C) / Math.Sqrt(A * A + B * B);
                d = Math.Min(d, p.Distance(Start));
                d = Math.Min(d, p.Distance(End));
                return d;
            }

            #endregion

        }

        public class Line
        {
            #region Private Members

            private Point bp;
            private Vector dir;

            #endregion

            #region Constructors

            public Line()
                : this(new Point(), new Vector(1, 0))
            {
            }

            public Line(Point p, Vector v)
            {
                bp = p;
                dir = v;
            }

            public Line(Point p1, Point p2)
                : this(p1, p2 - p1)
            {

            }

            public Line(double x1, double y1, double x2, double y2) :
                this(new Point(x1, y1), new Point(x2, y2))
            {
            }

            public Line(Segment s) :
                this(s.Start, s.Direction)
            {

            }

            #endregion

            #region Public Properties

            public Point BasePoint { get { return bp; } }
            public Vector Direction { get { return dir; } }
            public Vector NormalVector { get { return new Vector(-dir.y, dir.x); } }
            public double[] Coeffs
            {
                get
                {
                    return new double[3]
                {
                    dir.y,
                    -dir.x,
                    dir.x * bp.y - dir.y * bp.x
                };
                }
            }

            public double A { get { return dir.y; } }
            public double B { get { return -dir.x; } }
            public double C { get { return dir.x * bp.y - dir.y * bp.x; } }

            #endregion

            #region Public Methods

            public bool Intersects(Line line, out Point pt)
            {
                pt = new Point();

                double d = GeometryUtils.Determinant(A, B, line.A, line.B);
                if (GeometryUtils.Sign(d) == 0)
                    return false;

                pt.x = -GeometryUtils.Determinant(C, B, line.C, line.B) / d;
                pt.y = -GeometryUtils.Determinant(A, C, line.A, line.C) / d;

                return true;
            }

            public bool Parallel(Line line)
            {
                double d = GeometryUtils.Determinant(A, B, line.A, line.B);
                return GeometryUtils.Sign(d) == 0;
            }

            public bool Equivalent(Line line)
            {
                double d1 = GeometryUtils.Determinant(A, B, line.A, line.B);
                double d2 = GeometryUtils.Determinant(A, C, line.A, line.C);
                double d3 = GeometryUtils.Determinant(B, C, line.B, line.C);

                return GeometryUtils.Sign(d1) == 0 && GeometryUtils.Sign(d2) == 0 && GeometryUtils.Sign(d2) == 0;
            }

            public double Distance(Point p)
            {
                return (A * p.x + B * p.y + C) / Math.Sqrt(A * A + B * B);
            }

            #endregion
        }

    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.IO;
using System.Linq;
class Program
{
    class Point
    {
        public double x, y;
        public Point(double x, double y)
        {
            this.x = x;
            this.y = y;
        }
    }
    class Line
    {
        public double a, b, c;
        public Line(Point p1, Point p2)
        {
            a = p2.y - p1.y;
            b = p1.x - p2.x;
            c = a * p1.x + b * p1.y;
        }
        public  Line()
        {

        }

        public Line prep( Point p)
        {
            Line res=new Line();
            res.a = -b;
            res.b = a;
            res.c = res.a * p.x + res.b * p.y;
            return res;

        }
        public Point Intersect(Line l)
        {
            Point res = new Point(0,0);
            double d = a * l.b - b * l.a;
            res.x = (l.b * c - b * l.c) / d;
            res.y = (a * l.c - l.a * c) / d;
            return res;
        }

    }
    double eps = 1e-9;
    void solve()
    {
        Point p = new Point(nextInt(), nextInt());
        Point v=new Point(nextInt(),nextInt());
        Point[]w=new Point[2];

        for (int i = 0; i < 2; i++)
            w[i] = new Point(nextInt(), nextInt());
        Point[] mir = new Point[2];
        for (int i = 0; i < 2; i++)
            mir[i] = new Point(nextInt(), nextInt());

        bool ok = false;
        if (good(p, v, w[0], w[1]))
            ok = true;
        else if (sign(cross(mir[0], mir[1],p)) * sign(cross(mir[0], mir[1],v)) ==1)
        {
            Line lm = new Line(mir[0], mir[1]);
            Line pr = lm.prep(p);
            Point inter = lm.Intersect(pr);
            Point other = new Point(inter.x + (inter.x - p.x), inter.y + (inter.y - p.y));
            {
                Line l = new Line(other, v);
                Point x = l.Intersect(lm);
                if (good(x, p, w[0], w[1]) && good(x, v, w[0], w[1]) && on(mir[0],mir[1],x))
                    ok = true;
            }

        }
        if (ok)
            println("YES");
        else
            println("NO");

    }

    private bool good(Point p1, Point p2, Point p3, Point p4)
    {
        double d1 = cross(p1, p2, p3);
        double d2 = cross(p1, p2, p4);
        double d3 = cross(p3, p4,p1);
        double d4 = cross(p3, p4, p2);
        int x1 = sign(d1);
        int x2 = sign(d2);
        int x3 = sign(d3);
        int x4 = sign(d4);
        if (x1 * x2 < 0 && x3 * x4 < 0)
            return false;
        if (x1 == 0)
        {
            if (on(p1, p2, p3))
                return false;
        }
        if (x2 == 0)
        {
            if (on(p1, p2, p4))
                return false;
        }
        if (x3 == 0)
        {
            if (on(p3, p4, p1))
                return false;
        }
        if (x4 == 0)
        {
            if (on(p3, p4, p2))
                return false;
        }

        return true;

    }

    private bool on(Point p1, Point p2, Point p3)
    {
        return on(p1.x, p2.x, p3.x) && on(p1.y, p2.y, p3.y);
    }

    private bool on(double x, double y, double z)
    {
        return z >= Math.Min(x, y) - eps && z <= Math.Max(x, y) + eps;
    }

    private int sign(double d1)
    {
        return Math.Abs(d1) < eps ? 0 : Math.Sign(d1);
    }

    private double cross(Point p1, Point p2, Point p3)
    {
        return (p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y);
    }

    ////////////
    private void println(int[] ar)
    {
        for (int i = 0; i < ar.Length; i++)
        {
            if (i == ar.Length - 1)
                println(ar[i]);
            else
                print(ar[i] + " ");
        }
    }
    private void println(int[] ar, bool add)
    {
        int A = 0;
        if (add)
            A++;
        for (int i = 0; i < ar.Length; i++)
        {
            if (i == ar.Length - 1)
                println(ar[i] + A);
            else
                print((ar[i] + A) + " ");
        }
    }

    private void println(string Stringst)
    {
        Console.WriteLine(Stringst);
    }
    private void println(char charnum)
    {
        Console.WriteLine(charnum);
    }
    private void println(int Intnum)
    {
        Console.WriteLine(Intnum);
    }
    private void println(long Longnum)
    {
        Console.WriteLine(Longnum);
    }
    private void println(double Doublenum)
    {
        string s = Doublenum.ToString(CultureInfo.InvariantCulture);
        Console.WriteLine(s);
    }

    private void print(string Stringst)
    {
        Console.Write(Stringst);
    }
    private void print(int Intnum)
    {
        Console.Write(Intnum);
    }
    private void print(char charnum)
    {
        Console.Write(charnum);
    }
    private void print(long Longnum)
    {
        Console.Write(Longnum);
    }
    private void print(double Doublenum)
    {
        Console.Write(Doublenum);
    }

    string[] inputLine = new string[0];
    int inputInd = 0;
    string nextLine()
    {
        return Console.ReadLine();
    }
    void readInput()
    {
        if (inputInd != inputLine.Length)
            throw new Exception();
        inputInd = 0;
        inputLine = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        if (inputLine.Length == 0)
            readInput();

    }
    int nextInt()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return int.Parse(inputLine[inputInd++]);
    }
    long nextLong()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return long.Parse(inputLine[inputInd++]);
    }
    double nextDouble()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return double.Parse(inputLine[inputInd++]);
    }
    string nextString()
    {
        if (inputInd == inputLine.Length)
            readInput();
        return inputLine[inputInd++];
    }
    static void Main(string[] args)
    {
        new Program().solve();
    }
}


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = Convert.ToInt16(Console.ReadLine());
            if (num >= 2)
                Console.WriteLine("25");
            else
                return;
        }
    }
}


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

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            long long int n;
            n = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("25");
        }
    }
}


using System;
using System.Linq;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        int n = int.Parse(Console.ReadLine());
        var arrA = Console.ReadLine().Trim().Split().Select(x => int.Parse(x)).ToList();
        var arrB = Console.ReadLine().Trim().Split().Select(x => int.Parse(x)).ToList();
        Dictionary<string,bool> dict = new Dictionary<string,bool>();
        bool ok = false;
        int currentpos = 1;
        while(true){
            if(currentpos == arrA.Count){
                Console.WriteLine((currentpos - 1) + " " + 2);
                //Console.WriteLine();
                ok = true;
                break;
            }
            if(currentpos == arrB.Count){
                Console.WriteLine((currentpos - 1) + " " + 1);
                ok = true;
                break;
            }
            var str = getKey(arrA,currentpos,arrB);
            Console.WriteLine(str);
            if(dict.ContainsKey(str)){
                //Console.WriteLine(str);
                Console.WriteLine(-1);
                ok = true;
                break;
            }
            if(arrA[currentpos] > arrB[currentpos]){
                arrA.Add(arrB[currentpos]);
                arrA.Add(arrA[currentpos]);
            }else{
                arrB.Add(arrA[currentpos]);
                arrB.Add(arrB[currentpos]);
            }
            dict.Add(str,true);
            currentpos++;
        }

    }

    static string getKey(List<int> arrA , int startPos , List<int> arrB){
        string key = string.Empty;
        for(int i = startPos ; i < arrA.Count ; i++){
            key += arrA[i];
        }
        key + "X";
        for(int i = startPos ; i < arrB.Count ; i++){
            key += arrB[i];
        }
        return key;
    }
}


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

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int w1, h1, w2, h2, result;
            string []s;
           do
            {
            s = Console.ReadLine().Split(' ');
            w1 = int.Parse(s[0]);
            h1 = int.Parse(s[1]);
            w2 = int.Parse(s[2]);
            h2 = int.Parse(s[3]);
            } while (w1<w2)

            result = w1 + h1 + h2 + w2 + h2 + h2;

            if (w1 == w2)
                result += 4;
            else
                result += 5;
            Console.WriteLine(result);
            Console.ReadKey();
        }
    }
}


using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using Debug = System.Diagnostics.Debug;

class P
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(int.Parse).ToList();
        //- - - -
        //下の辺
        long res = 0;
        res += a[0] + 2;
        res += a[2] + 2;
        res += (a[1] + a[3]) * 2;
        res += Abs(a[1] - a[3]);
        Console.WriteLine(res);
    }
}


//#undef DEBUG

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace codeforces
{
    class C
    {
        //  test
        static CodeforcesUtils CF = new CodeforcesUtils(
@"
A<B
B>C
C>A
");

        class Solver
        {
            public void Solve()
            {
                int[] p = new int[3];
                for (int i = 0; i < 3; i++)
                {
                    string s = CF.ReadLine();
                    if (s[1] == '<')
                    {
                        p[s[2] - 'A']++;
                    }
                    else
                    {
                        p[s[0] - 'A']++;
                    }
                }

                if (p[0] == 1 && p[1] == 0)
                {
                    CF.WriteLine("Impossible");
                    return;
                }

                char[] cs = new char[3];
                cs[p[0]] = 'A';
                cs[p[1]] = 'B';
                cs[p[2]] = 'C';
                foreach (char c in cs)
                    CF.Write(c);
            }
        }

        #region test

        static void Main(string[] args)
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ru-RU");

            new Solver().Solve();
            CF.Close();
        }

        static void TLE()
        {
            for (; ; ) ;
        }

        class CodeforcesUtils
        {
            public string ReadLine()
            {
#if DEBUG
                if (_lines == null)
                {
                    _lines = new List<string>();
                    string[] ss = _test_input.Replace("\n", "").Split('\r');
                    for (int i = 0; i < ss.Length; i++)
                    {
                        if (
                            (i == 0 || i == ss.Length - 1) &&
                            ss[i].Length == 0
                            )
                            continue;

                        _lines.Add(ss[i]);
                    }
                }

                string s = null;
                if (_lines.Count > 0)
                {
                    s = _lines[0];
                    _lines.RemoveAt(0);
                }
                return s;

#else
                //return _sr.ReadLine();
            return Console.In.ReadLine();
#endif
            }

            public void WriteLine(object o)
            {
#if DEBUG
                System.Diagnostics.Trace.WriteLine(o);
#else
                //_sw.WriteLine(o);
            Console.WriteLine(o);
#endif
            }

            public void Write(object o)
            {
#if DEBUG
                System.Diagnostics.Trace.Write(o);
#else
                 //_sw.Write(o);
           Console.Write(o);
#endif
            }

            string _test_input;

            List<string> _lines;

#if DEBUG
            public CodeforcesUtils(string test_input)
            {
                _test_input = test_input;
            }
#else

            public CodeforcesUtils(string dummy)
            {
                //_sr = new System.IO.StreamReader("input.txt");
                //_sw = new System.IO.StreamWriter("output.txt");
            }
#endif

            public void Close()
            {
                if( _sr!= null)
                    _sr.Close();
                if( _sw != null)
                    _sw.Close();
            }

            System.IO.StreamReader _sr=null;
            System.IO.StreamWriter _sw=null;

        }

        #endregion
    }
}


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

namespace VK_Cup_CSharp_Wildcard_1
{
    public class Program
    {
        private const long MaxNumber = 2 * 1000 * 1000 * 1000;
        private static HashSet<long> allNumbers = new HashSet<long>();

        private static void GenerateAllNumbers(long nextNumber)
        {
            if (nextNumber > MaxNumber)
            {
                return;
            }

            allNumbers.Add(nextNumber);
            GenerateAllNumbers(2 * nextNumber);
            GenerateAllNumbers(3 * nextNumber);
        }

        public static void Main(string[] args)
        {
            GenerateAllNumbers(1);

            var line = Console.ReadLine()?.Split().ToList();
            long left = long.Parse(line[0]);
            long right = long.Parse(line[1]);

            int count = 0;

            foreach (var number23 in allNumbers)
            {
                if (number23 >= left && number23 <= right)
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}


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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int left;
            int right;
            string line = Console.ReadLine();
            string[] splitLine = line.Split(' ');

            Int32.TryParse(splitLine[0], out left);
            Int32.TryParse(splitLine[1], out right);
            int abc=0;
            for (int i = left; i < right; i++)
            {
                int tmp = i;
                while (tmp % 2 == 0) tmp = tmp / 2;
                while (tmp % 3 == 0) tmp = tmp / 3;
                if (tmp == 1)
                    abc++;
            }
            System.Console.Write(abc);
        }
    }
}


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

namespace TMP
{
    class Program
    {
        private static int Alex = 1;
        private static int Bob = 2;
        private static int Carl = 3;
        static void Main(string[] args)
        {
            // PrimeNumber primeNumber = new PrimeNumber();
            //primeNumber.GetPrimeNumbers();
            var gameNumber = Int32.Parse(Console.ReadLine());

            int spectating = Carl;
            int winner;
            int secondPlayer = Bob;

            for (var game = 0; game < gameNumber; game++)
            {
                winner = Int32.Parse(Console.ReadLine());

                if (winner == spectating || secondPlayer == spectating)
                {
                    Console.Write("NO");
                    return;
                }
                secondPlayer = spectating;

                if (winner == 1)
                {
                    if (secondPlayer == 2)
                    {
                        spectating = 3;
                    }
                    if (secondPlayer == 3)
                    {
                        spectating = 2;
                    }
                }
                if (winner == 2)
                {
                    if (secondPlayer == 1)
                    {
                        spectating = 3;
                    }
                    if (secondPlayer == 3)
                    {
                        spectating = 2;
                    }
                }
                if (winner == 3)
                {
                    if (secondPlayer == 1)
                    {
                        spectating = 2;
                    }
                    if (secondPlayer == 2)
                    {
                        spectating = 1;
                    }
                }

            }
            Console.Write("YES");
        }

    }
}


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

namespace bowling
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int leftHand = int.Parse(tokens[0]);
            int rightHand = int.Parse(tokens[1]);
            int ambidexters = int.Parse(tokens[2]);

            Console.WriteLine(maxGroupCount(leftHand, rightHand, ambidexters));

        }

        public static int maxGroupCount(int leftHand, int rightHand,int ambidexters) {

            leftHand += ambidexters;
            if (rightHand < leftHand) {
                int temp = rightHand;
                rightHand = leftHand;
                leftHand = temp;
            }

            if (leftHand == 0) return 0;
            else {
                int difference = rightHand - leftHand;
                if (difference == 0) return rightHand + leftHand;
                else {
                       rightHand -= difference;
                       return rightHand + leftHand + 2 * (difference / 2);
                }
            }
        }
    }
}


using System;
using System.linq;
class Task {

    static void Main() {
        var n = Convert.ToInt32(Console.ReadLine());
        var original = Console.ReadLine();

        string[] str = new string[n - 1];
        for(int i = 0; i < n - 1; i++) {
            str[i] = Char.ToString(original[i]) + Char.ToString(original[i + 1]);
        }

        int[] nums = new int[n - 1];
        int count = 0;

        for(int i = 0; i < n - 1; i++) {
            count = str.Count(f => f == str[i]);
            nums[i] = count;
        }

        Console.WriteLine(str[nums.ToList().IndexOf(nums.Max())]);

    }
}


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

namespace Two_gram
{
    class Program
    {
        static void Main(string[] args)
        {
            int size = int.Parse(Console.ReadLine());
            string letter = Console.ReadLine();
            Dictionary<string, int> dict = new Dictionary<string, int>();
            string temp;

            for (int i = 1; i < letter.Length; i++)
            {
                temp = letter[i - 1].ToString() + letter[i].ToString();
                if (dict.ContainsKey(temp)) dict[temp]++;
                else dict.Add(temp, 1);
            }
            Console.WriteLine(dict.FirstOrDefault(x=>x.Value==dict.Values.Max()).Key);s

        }
    }
}


// A Dynamic Programming based
// C# program to find minimum
// number operations to
// convert str1 to str2
using System;
using System.Collections.Generic;
using System.Linq;
class GFG
{

    public static void Main()
    {
        List<int> arr = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList<int>();
        var op = Console.ReadLine().Split(' ').ToArray();
        Console.Write(SmallestNumber(arr, op, 0, long.MaxValue));
    }

    public static long SmallestNumber(List<int> arr, string[] ope, int opeCount, long min)
    {

        if (arr.Count == 1)
            return arr[0];
        int min1 = int.MaxValue;
        int min2 = int.MaxValue;

        for (int i = 0; i < arr.Count; i++)
        {
            for (int j = i + 1; j < arr.Count; j++)
            {
                if (ope[opeCount] == "+")
                {
                    var listNew = new List<int>(arr);
                    var tmp = listNew[i] + listNew[j];
                    listNew.RemoveAt(j);
                    listNew.RemoveAt(i);
                    listNew.Add(tmp);
                    min = Math.Min(min, SmallestNumber(listNew, ope, opeCount + 1, min));
                }
                if (ope[opeCount] == "*")
                {
                    var listNew = new List<int>(arr);
                    var tmp = listNew[i] * listNew[j];
                    listNew.RemoveAt(j);
                    listNew.RemoveAt(i);

                    listNew.Add(tmp);
                    min = Math.Min(min, SmallestNumber(listNew, ope, opeCount + 1, min));
                }
            }
        }

        //min = Math.Min(min1, min2);
        return min;
    }
}


//#define TEST
#if TEST
using System.IO;
#endif

using System;

namespace CF
{
    #region Start
#if !TEST
    using cin = Console;
    using cout = Console;
#endif
#endregion
    class Program
    {
        static long[,] Varinats(long[] mas, string opr)
        {

            long[,] ans;
            if (mas.Length == 4) ans = new long[6, mas.Length - 1];
            else if (mas.Length == 3) ans = new long[3, mas.Length - 1];
            else if (mas.Length == 2) ans = new long[1, mas.Length - 1];
            else ans = new long[1, mas.Length - 1];

            if (opr == "+")
            {
                int N = 0;
                for (int i = 0; i < mas.Length - 1; i++)
                {
                    if (mas[i] >= 0)
                    {
                        for (int j = i + 1; j < mas.Length; j++)
                        {
                            if (mas[j] >= 0)
                            {
                                for (int k = 0; k < mas.Length; k++)
                                {
                                    if(k<j)
                                        ans[N, k] = mas[k];
                                    else
                                        if (k > j) ans[N, k-1] = mas[k];
                                }
                                ans[N, i] = mas[i] + mas[j];
                                N++;
                            }
                        }
                    }
                }
            }
            else
            {
                int N = 0;
                for (int i = 0; i < mas.Length - 1; i++)
                {
                    if (mas[i] >= 0)
                    {
                        for (int j = i + 1; j < mas.Length; j++)
                        {
                            if (mas[j] >= 0)
                            {
                                for (int k = 0; k < mas.Length; k++)
                                {
                                    if (k < j)
                                        ans[N, k] = mas[k];
                                    else
                                        if (k > j) ans[N, k - 1] = mas[k];
                                }
                                ans[N, i] = mas[i] * mas[j];
                                N++;
                            }
                        }
                    }
                }
            }
            return ans;
        }
        static void Main(string[] args)
        {
            #region BEGIN
            #if TEST
            string filepath = @"E:\Projects 2010\CF55\B\";
            FileStream file = new FileStream(String.Concat(filepath, @"input.txt"), FileMode.Open, FileAccess.Read);
            StreamReader cin = new StreamReader(file);
            FileStream fileOut = new FileStream(String.Concat(filepath, @"output.txt"), FileMode.Truncate, FileAccess.Write);
            StreamWriter cout = new StreamWriter(fileOut, System.Text.Encoding.Unicode);
            #endif
            try
            {
            #endregion
                long ANS = -1;
                string[] st = cin.ReadLine().Split(' ');
                long[] mas = new long[4];
                for (int i = 0; i < mas.Length; i++) mas[i] = long.Parse(st[i]);

                string[] opr = cin.ReadLine().Split(' ');
                int mult=0,
                    summ=0;
                for (int i = 0; i < opr.Length; i++) if (opr[i] == "*") mult++; else summ++;

                if (mult == 3)
                {
                    long[,] ans1 = Varinats(mas, "*");
                    for (int i = 0; i < ans1.GetLength(0); i++)
                    {
                        long[] ans2 = new long[ans1.GetLength(1)];
                        for (int j = 0; j < ans1.GetLength(1); j++)
                            ans2[j] = ans1[i, j];

                        long[,] ans3 = Varinats(ans2, "*");
                        for (int k = 0; k < ans3.GetLength(0); k++)
                        {
                            long[] ans4 = new long[ans3.GetLength(1)];
                            for (int j = 0; j < ans3.GetLength(1); j++)
                                ans4[j] = ans3[k, j];

                            if (ANS < 0 || ANS > ans4[0] * ans4[1]) ANS = ans4[0] * ans4[1];
                        }
                    }
                    cout.WriteLine(ANS);
                    return;
                }
                if (summ == 3)
                {
                    long[,] ans1 = Varinats(mas, "+");
                    for (int i = 0; i < ans1.GetLength(0); i++)
                    {
                        long[] ans2 = new long[ans1.GetLength(1)];
                        for (int j = 0; j < ans1.GetLength(1); j++)
                            ans2[j] = ans1[i, j];

                        long[,] ans3 = Varinats(ans2, "+");
                        for (int k = 0; k < ans3.GetLength(0); k++)
                        {
                            long[] ans4 = new long[ans3.GetLength(1)];
                            for (int j = 0; j < ans3.GetLength(1); j++)
                                ans4[j] = ans3[k, j];

                            if (ANS < 0 || ANS > ans4[0] + ans4[1]) ANS = ans4[0] + ans4[1];
                        }
                    }
                    cout.WriteLine(ANS);
                    return;
                }

                if (mult > summ)
                {
                    //+**
                    long[,] ans1 = Varinats(mas, "+");
                    for (int i = 0; i < ans1.GetLength(0); i++)
                    {
                        long[] ans2=new long[ans1.GetLength(1)];
                        for (int j = 0; j < ans1.GetLength(1); j++)
                            ans2[j] = ans1[i, j];

                        long[,] ans3 = Varinats(ans2, "*");
                        for (int k = 0; k < ans3.GetLength(0); k++)
                        {
                            long[] ans4 = new long[ans3.GetLength(1)];
                            for (int j = 0; j < ans3.GetLength(1); j++)
                                ans4[j] = ans3[k, j];

                            if (ANS < 0 || ANS > ans4[0] * ans4[1]) ANS = ans4[0] * ans4[1];
                        }
                    }
                    //*+*
                    ans1 = Varinats(mas, "*");
                    for (int i = 0; i < ans1.GetLength(0); i++)
                    {
                        long[] ans2 = new long[ans1.GetLength(1)];
                        for (int j = 0; j < ans1.GetLength(1); j++)
                            ans2[j] = ans1[i, j];

                        long[,] ans3 = Varinats(ans2, "+");
                        for (int k = 0; k < ans3.GetLength(0); k++)
                        {
                            long[] ans4 = new long[ans3.GetLength(1)];
                            for (int j = 0; j < ans3.GetLength(1); j++)
                                ans4[j] = ans3[k, j];

                            if (ANS < 0 || ANS > ans4[0] * ans4[1]) ANS = ans4[0] * ans4[1];
                        }
                    }
                    //**+
                    ans1 = Varinats(mas, "*");
                    for (int i = 0; i < ans1.GetLength(0); i++)
                    {
                        long[] ans2 = new long[ans1.GetLength(1)];
                        for (int j = 0; j < ans1.GetLength(1); j++)
                            ans2[j] = ans1[i, j];

                        long[,] ans3 = Varinats(ans2, "*");
                        for (int k = 0; k < ans3.GetLength(0); k++)
                        {
                            long[] ans4 = new long[ans3.GetLength(1)];
                            for (int j = 0; j < ans3.GetLength(1); j++)
                                ans4[j] = ans3[k, j];

                            if (ANS < 0 || ANS > ans4[0] + ans4[1]) ANS = ans4[0] + ans4[1];
                        }
                    }
                }
                else
                {
                    //*++
                    long[,] ans1 = Varinats(mas, "*");
                    for (int i = 0; i < ans1.GetLength(0); i++)
                    {
                        long[] ans2 = new long[ans1.GetLength(1)];
                        for (int j = 0; j < ans1.GetLength(1); j++)
                            ans2[j] = ans1[i, j];

                        long[,] ans3 = Varinats(ans2, "+");
                        for (int k = 0; k < ans3.GetLength(0); k++)
                        {
                            long[] ans4 = new long[ans3.GetLength(1)];
                            for (int j = 0; j < ans3.GetLength(1); j++)
                                ans4[j] = ans3[k, j];

                            if (ANS < 0 || ANS > ans4[0] + ans4[1]) ANS = ans4[0] + ans4[1];
                        }
                    }
                    //+*+
                    ans1 = Varinats(mas, "+");
                    for (int i = 0; i < ans1.GetLength(0); i++)
                    {
                        long[] ans2 = new long[ans1.GetLength(1)];
                        for (int j = 0; j < ans1.GetLength(1); j++)
                            ans2[j] = ans1[i, j];

                        long[,] ans3 = Varinats(ans2, "*");
                        for (int k = 0; k < ans3.GetLength(0); k++)
                        {
                            long[] ans4 = new long[ans3.GetLength(1)];
                            for (int j = 0; j < ans3.GetLength(1); j++)
                                ans4[j] = ans3[k, j];

                            if (ANS < 0 || ANS > ans4[0] + ans4[1]) ANS = ans4[0] + ans4[1];
                        }
                    }
                    //++*
                    ans1 = Varinats(mas, "+");
                    for (int i = 0; i < ans1.GetLength(0); i++)
                    {
                        long[] ans2 = new long[ans1.GetLength(1)];
                        for (int j = 0; j < ans1.GetLength(1); j++)
                            ans2[j] = ans1[i, j];

                        long[,] ans3 = Varinats(ans2, "+");
                        for (int k = 0; k < ans3.GetLength(0); k++)
                        {
                            long[] ans4 = new long[ans3.GetLength(1)];
                            for (int j = 0; j < ans3.GetLength(1); j++)
                                ans4[j] = ans3[k, j];

                            if (ANS < 0 || ANS > ans4[0] * ans4[1]) ANS = ans4[0] * ans4[1];
                        }
                    }
                }
                cout.WriteLine(ANS);
            #region END
            }

            catch (Exception e)
            {
                #if TEST
                cout.WriteLine(e.Message);
                cout.WriteLine("----------------------");
                cout.WriteLine(e.StackTrace);
                #endif
            }
            finally
            {
                #if TEST
                cout.Close();
                cin.Close();
                fileOut.Close();
                file.Close();
                #endif
            }
            #endregion
        }
    }
}


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

namespace Clear_Symmetry
{
    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 n4 = n/4;
            bool f2 = n%4 > 1;
            int count;
            if (n == 1)
            {
                count = 1;
            }
            else if (n == 2)
            {
                count = 3;
            }
            else if (n%2 == 1 || f2)
            {
                for (int i = f2 ? 5 : 3;; i += 2)
                {
                    var kk = new int[i,i];
                    if (n%2 == 1)
                        kk[(i + 1)/2 - 1, i/2 - 1] = 1;
                    if (f2)
                    {
                        kk[i/2 - 1, 0] = 1;
                        kk[(i + 1)/2 - 1, 0] = 1;
                        kk[(i + 1)/2 - 1, 1] = 1;
                    }

                    int c1 = 0, c0 = 0;
                    for (int j = (i + 1)/2 - 1; j >= 0; j--)
                    {
                        for (int k = i/2 - 1; k >= 0; k--)
                        {
                            if (kk[j, k] == 1)
                                continue;
                            if ((j + k)%2 == 1)
                                c1++;
                            else c0++;
                        }
                    }
                    if (Math.Max(c1, c0) >= n4)
                    {
                        count = i;
                        break;
                    }
                }
            }
            else
            {
                for (int i = 3;; i ++)
                {
                    var kk = new int[i,i];

                    int c1 = 0, c0 = 0;
                    for (int j = (i + 1)/2 - (i%2 == 1 ? 1 : 2); j >= 0; j--)
                    {
                        for (int k = i/2 - (i%2 == 1 ? 1 : 2); k >= 0; k--)
                        {
                            if (kk[j, k] == 1)
                                continue;
                            if ((j + k)%2 == 1)
                                c1++;
                            else c0++;
                        }
                    }
                    if (Math.Max(c1, c0) >= n4)
                    {
                        count = i;
                        break;
                    }
                }
            }

            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.Linq;

namespace SP.Solutions.CodeForces.c338_196_1
{
	public class ProgramC
	{
	    private static long bestRes = long.MaxValue;

		public static void Main()
		{
			checked
			{
			    bestRes = long.MaxValue;
			    int n = int.Parse(Console.ReadLine());
			    var arr = Console.ReadLine().Split(' ').Select(long.Parse).Distinct().ToArray();
                Array.Sort(arr);

			    var primes = GetPrimes();

			    var nodes = new List<Node>();
                for (int i = 0; i < arr.Length; i++)
                {
                    nodes.Add(new Node(arr[i], getFactors(arr[i], primes), arr[i], false, 0));
                }

			    TryBuildTrees(nodes);
                Console.WriteLine(bestRes);
			}
		}

	    private static void TryBuildTrees(List<Node> nodes)
	    {
	        for (int i = 0 ; i  <nodes.Count ; i++)
	        for (int j = 0 ; j  <nodes.Count ; j++) if (j != i && !nodes[j].HasParent && nodes[i].Rem%nodes[j].N == 0)
	        {
	            var newNodes = new List<Node>();
                for (int k = 0; k < nodes.Count; k++) if (k != i && k != j) newNodes.Add(nodes[k]);
	            int add = nodes[j].Factors > 1 ? 1 : 0;
	            newNodes.Add(new Node(nodes[i].N, nodes[i].Factors, nodes[i].Rem/nodes[j].N, false, nodes[i].addFactors + nodes[j].addFactors + add));
                newNodes.Add(new Node(nodes[j].N, nodes[j].Factors, nodes[j].Rem, true, nodes[j].addFactors));
                TryBuildTrees(newNodes);
	        }

	        CalcPrice(nodes);
	    }

	    private static void CalcPrice(List<Node> nodes)
	    {
	        int n = 0;
	        long res = 0;
            foreach (var node in nodes) if (!node.HasParent)
            {
                if (node.Factors > 1) res++;
                res += node.Factors + node.addFactors;
                n++;
            }
	        if (n > 1) res++;
	        bestRes = Math.Min(bestRes, res);
	    }

	    static int getFactors(long n, long[] primes)
        {
            int res = 0;
            int i = 0;
            while (n > 1)
            {
                if (n%primes[i] == 0)
                {
                    res++;
                    n /= primes[i];
                }
                else i++;
            }
            return res;
        }

        class Node
        {
            public override string ToString()
            {
                return string.Format("HasParent: {0}, N: {1}, Factors: {2}, Rem: {3}", HasParent, N, Factors, Rem);
            }

            public bool HasParent;
            public readonly long N;
            public readonly int Factors;
            public readonly long Rem;
            public readonly int addFactors;

            public Node(long n, int factors, long rem, bool hasParent, int addFactors)
            {
                HasParent = hasParent;
                this.addFactors = addFactors;
                N = n;
                Factors = factors;
                Rem = rem;
            }
        }

	    private static long[] GetPrimes()
	    {
	        const int max = 1000000;
	        var primes = new List<long>(80000);
	        primes.Add(2);
	        var isNotPrime = new bool[max + 1];
            for (int i = 3 ; i<= max ; i+=2) if (!isNotPrime[i])
            {
                primes.Add(i);
                for (int j = i*i; j <= max && j > 0; j += i) isNotPrime[j] = true;
            }
	        return primes.ToArray();
	    }
	}
}


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

namespace SP.Solutions.CodeForces.c338_196_1
{
	public class ProgramC
	{
	    private static long bestRes = long.MaxValue;

		public static void Main()
		{
			checked
			{
			    bestRes = long.MaxValue;
			    int n = int.Parse(Console.ReadLine());
			    var arr = Console.ReadLine().Split(' ').Select(long.Parse).Distinct().ToArray();
                Array.Sort(arr);

			    var primes = GetPrimes();

			    var nodes = new List<Node>();
                for (int i = 0; i < arr.Length; i++)
                {
                    nodes.Add(new Node(arr[i], getFactors(arr[i], primes), arr[i], false, 0));
                }

			    TryBuildTrees(nodes);
                Console.WriteLine(bestRes);
			}
		}

	    private static void TryBuildTrees(List<Node> nodes)
	    {
	        for (int i = 0 ; i  <nodes.Count ; i++)
	        for (int j = 0 ; j  <nodes.Count ; j++) if (j != i && !nodes[j].HasParent && nodes[i].Rem%nodes[j].N == 0)
	        {
	            var newNodes = new List<Node>();
                for (int k = 0; k < nodes.Count; k++) if (k != i && k != j) newNodes.Add(nodes[k]);
	            int add = nodes[j].Factors > 1 ? 1 : 0;
	            newNodes.Add(new Node(nodes[i].N, nodes[i].Factors, nodes[i].Rem/nodes[j].N, false, nodes[i].addFactors + nodes[j].addFactors + add));
                newNodes.Add(new Node(nodes[j].N, nodes[j].Factors, nodes[j].Rem, true, nodes[j].addFactors));
                TryBuildTrees(newNodes);
	        }

	        CalcPrice(nodes);
	    }

	    private static void CalcPrice(List<Node> nodes)
	    {
	        int n = 0;
	        long res = 0;
            foreach (var node in nodes) if (!node.HasParent)
            {
                if (node.Factors > 1) res++;
                res += node.Factors + node.addFactors;
                n++;
            }
	        if (n > 1) res++;
	        bestRes = Math.Min(bestRes, res);
	    }

	    static int getFactors(long n, long[] primes)
        {
            int res = 0;
            int i = 0;
            while (n > 1 && i < primes.Length)
            {
                if (n%primes[i] == 0)
                {
                    res++;
                    n /= primes[i];
                }
                else i++;
            }
	        if (i == primes.Length) res++;
            return res;
        }

        class Node
        {
            public override string ToString()
            {
                return string.Format("HasParent: {0}, N: {1}, Factors: {2}, Rem: {3}", HasParent, N, Factors, Rem);
            }

            public bool HasParent;
            public readonly long N;
            public readonly int Factors;
            public readonly long Rem;
            public readonly int addFactors;

            public Node(long n, int factors, long rem, bool hasParent, int addFactors)
            {
                HasParent = hasParent;
                this.addFactors = addFactors;
                N = n;
                Factors = factors;
                Rem = rem;
            }
        }

	    private static long[] GetPrimes()
	    {
	        const int max = 1000000;
	        var primes = new List<long>(80000);
	        primes.Add(2);
	        var isNotPrime = new bool[max + 1];
            for (int i = 3 ; i<= max ; i+=2) if (!isNotPrime[i])
            {
                primes.Add(i);
                for (int j = i*i; j <= max && j > 0; j += i) isNotPrime[j] = true;
            }
	        return primes.ToArray();
	    }
	}
}


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

namespace CD2
{
    class Program
    {
        #region Reusable
        static int[] GetIntArray()
        {
            return Array.ConvertAll(Console.ReadLine().Trim().Split(' '), int.Parse);
        }
        static double[] GetDoubleArray()
        {
            return Array.ConvertAll(Console.ReadLine().Trim().Split(' '), Convert.ToDouble);
        }
        static List<int> GetIntArray(int n)
        {
            List<int> ips = new List<int>();
            if (n == null)
            {
                string ip = Console.ReadLine().Trim();
                while (!string.IsNullOrEmpty(ip))
                {
                    ips.Add(Convert.ToInt32(ip));
                    ip = Console.ReadLine().Trim();
                }
            }
            else
            {
                while (n-- > 0)
                {
                    ips.Add(Convert.ToInt32(Console.ReadLine().Trim()));
                }
            }
            return ips;
        }
        static string[] GetStringArray()
        {
            return Console.ReadLine().Trim().Split(' ');
        }
        static int GetN()
        {
            return Convert.ToInt32(Console.ReadLine().Trim());
        }
        static bool[] GetSieve(int max)
        {
            long sum = 0;
            long n = 2000000;
            bool[] e = new bool[n];//by default they're all false
            for (int i = 2; i < n; i++)
            {
                e[i] = true;//set all numbers to true
            }
            //weed out the non primes by finding mutiples
            for (int j = 2; j < n; j++)
            {
                if (e[j])//is true
                {
                    for (long p = 2; (p * j) < n; p++)
                    {
                        e[p * j] = false;
                    }
                }
            }
            return e;
        }
        static bool IsPrime(int n)
        {
            if (n > 1)
            {
                return Enumerable.Range(2, n / 2).Where(x => n % x == 0).Count() == 0;
            }

            return false;
        }
        static List<int> GetListFromInt(int n)
        {
            List<int> arr = new List<int>();
            while (n > 0)
            {
                arr.Add(n % 10);
                n /= 10;
            }
            arr.Reverse();
            return arr;
        }
        static int GetIntFromArray(int[] arr)
        {
            int op = 0;
            foreach (int i in arr)
            {
                op = (op * 10) + i;
            }
            return op;
        }
        private static int GetMost(List<int> vals, int m)
        {
            int ct = vals.Count;
            int l = vals.Max();
            int h = vals.Sum();

            while (l < h)
            {
                int mp = 1;
                int cl = 0;
                int mid = l + (h - l) / 2;
                for (int i = 0; i < ct; ++i)
                {
                    if (cl + vals[i] <= mid) cl += vals[i];
                    else { ++mp; cl = vals[i]; }
                }
                if (mp <= m) h = mid;
                else l = mid + 1;
            }
            return l;
        }
        private static int GetLeast(List<int> vals, int m)
        {
            int max = -1;
            int ct = vals.Count;
            int h = vals[ct - 1];
            int l = 0;
            //int l = h;
            //for (int i = 1; i < ct; i++)
            //{
            //    int df = vals[i] - vals[i - 1];
            //    if (df < l) l = df;
            //}
            while (l < h)
            {
                int mp = 1;
                int prCwPos = vals[0];
                int mid = l + (h - l) / 2;
                for (int i = 1; i < ct; ++i)
                {
                    int d = vals[i] - prCwPos;
                    if (d >= mid)
                    {
                        mp++;
                        prCwPos = vals[i];
                    }
                }
                if (mp >= m) { l = mid + 1; if (mid > max) max = mid; }
                else h = mid;
            }
            return max;
        }
        static void Print(List<string> op, bool newLine)
        {
            if (newLine)
            {
                foreach (string s in op)
                {
                    Console.WriteLine(s);
                }
            }
            else
            {
                Console.WriteLine(string.Join(" ", op));
            }
        }
        static void Print2DArray(int[,] ar)
        {
            for (int i = 0; i < ar.GetLength(0); i++)
            {
                string op = string.Empty;
                for (int j = 0; j < ar.GetLength(1); j++)
                {
                    if (op == string.Empty) op = ar[i, j].ToString();
                    else op += " " + ar[i, j].ToString();
                }
                Console.WriteLine(op);

            }
        }
        static void Print2DArray(bool[,] ar)
        {
            for (int i = 0; i < ar.GetLength(0); i++)
            {
                string op = string.Empty;
                for (int j = 0; j < ar.GetLength(1); j++)
                {
                    if (op == string.Empty) op = (ar[i, j] ? "1" : "0");
                    else op += " " + (ar[i, j] ? "1" : "0");
                }
                Console.WriteLine(op);

            }
        }
        #endregion
        static double pi = 3.14159265359;
        static void Main(string[] args)
        {
            //http://www.spoj.com/problems/PIE/

            a6();
            return;
        }

        private static void a6()
        {
            int[] ips = GetIntArray();
            int n = ips[0];
            int m = ips[1];
            //int ct = 0;
            //int h = (m + 1) / 2;
            //while(m > n)
            //{
            //    if (n > h)
            //    {
            //        ct += n - h;
            //        n = h;
            //    }
            //    while (n <= h)
            //    {
            //        n *= 2;
            //        ct++;
            //    }
            //}
            //if (n > m)
            //{
            //    ct += n - m;
            //}
            if (m <= n)
            {
                Console.WriteLine(n - m);
                return;
            }
            bool[] v = new bool[300000];
            int[] d = new int[300000];
            Queue<int> q = new Queue<int>();
            q.Enqueue(n);
            v[n] = true;

            while (q.Count > 0)
            {
                int el = q.Dequeue();
                if (el == m) break;
                int n1 = el - 1;

                if (n1 > 0) { q.Enqueue(n1); v[n1] = true; d[n1] = d[el] + 1; }
                if (el <= 50000)
                {
                    int n2 = el * 2;
                    q.Enqueue(n2);
                    v[n2] = true; d[n2] = d[el] + 1;
                }
            }
            Console.WriteLine(d[m]);
        }

        private static void a5()
        {
            int n = GetN();
            List<int> x = GetIntArray().ToList();
            x.Sort();
            int max = x.Count - 1;
            int min = 0;
            int q = GetN();
            List<int> m = new List<int>();
            for (int i = 0; i < q; i++)
            {
                m.Add(Convert.ToInt32(Console.ReadLine().Trim()));
            }
            foreach (var itm in m)
            {
                int h = max;
                int l = min;
                bool found = false;
                int c = 0;
                while (h >= l)
                {

                    int mid = l + (h - l) / 2;
                    if (x[mid] <= itm)
                    {
                        found = true;
                        if (c < mid) c = mid;
                        l = mid + 1;
                    }
                    else h = mid - 1;
                }
                Console.WriteLine((found ? (c + 1) : 0));
            }

        }

        private static void a4()
        {
            int[] ips = GetIntArray();
            int n = ips[0];
            int m = ips[1];
            List<List<int>> coll = new List<List<int>>();
            bool nonZero = false;
            for (int i = 0; i < n; i++)
            {
                coll.Add(new List<int>());
                int[] ipl = GetIntArray();
                coll[i].AddRange(ipl.Skip(1));
                if (coll[i].Count > 0) nonZero = true;
            }
            for (int i = 0; i < coll.Count; i++)
            {
                List<int> el = coll[i];
                for (int j = i + 1; j < coll.Count; j++)
                {
                    List<int> nxt = coll[j];
                    if (el.Any(p => nxt.Contains(p)))
                    {
                        coll[i].AddRange(nxt);
                        coll.RemoveAt(j);
                        j = i;
                    }
                }
            }

            if (nonZero) Console.WriteLine(coll.Count - 1);
            else Console.WriteLine(coll.Count);

        }

        private static void a3()
        {
            int n = GetN();
            List<int> ips = GetIntArray().ToList();
            ips.Sort();
            //List<int> ipl = new List<int>();
            //Dictionary<int, int> dict = new Dictionary<int, int>();
            List<int> f = new List<int>();
            //for (int i = 0; i < n; i++)
            //{
            //    int it = ips[i];
            //    if (!dict.ContainsKey(it))
            //    {
            //        dict.Add(it, 1);
            //    }
            //    else
            //    {
            //        dict[it] = dict[it] + 1;
            //    }
            //    if (!ipl.Contains(it)) ipl.Add(it);
            //    //else ipl.Add(it);
            //}
            int ct = 0;
            while (ips.Count > 0)
            {
                int el = ips[0];
                f.Add(el);
                int k = 1;
                while (k < ips.Count && ips[k] <= el) k++;
                if (k < ips.Count)
                {
                    f.Add(ips[k]);
                    ips.RemoveAt(k);
                }

                ips.RemoveAt(0);
            }
            //for (int i = 0; i < ipl.Count; i++)
            //{
            //    int el = ipl[i];
            //    j = i + 1;
            //    while (dict[el] != 0)
            //    {
            //        f.Add(el);
            //        dict[el] = dict[el] - 1;
            //        while(j<ipl.Count)
            //        {
            //            int nel = ipl[j];
            //            if (dict[nel] == 0) { j++; continue; };
            //            dict[nel] = dict[nel] - 1;
            //            f.Add(nel);
            //            break;
            //        }
            //    }
            //}

            for (int i = 0; i < f.Count - 1; i++)
            {
                if (f[i] < f[i + 1]) ct++;
            }
            Console.WriteLine(ct);
        }

        private static void a2()
        {
            bool[,] v = new bool[5, 5];
            int[,] d = new int[5, 5];
            Queue<Tuple<int, int>> q = new Queue<Tuple<int, int>>();
            int[] dx = new int[] { 1, 0, -1, 0 };
            int[] dy = new int[] { 0, 1, 0, -1 };

            for (int i = 0; i < 5; i++)
            {
                int[] ips = GetIntArray();
                for (int j = 0; j < 5; j++)
                {
                    if (ips[j] == 1)
                    {
                        q.Enqueue(new Tuple<int, int>(i, j));
                        v[i, j] = true;
                        break;
                    }
                }
            }
            while (q.Count > 0)
            {
                var el = q.Dequeue();
                int x = el.Item1;
                int y = el.Item2;
                if (x == 2 && y == 2)
                {
                    Console.WriteLine(d[el.Item1, el.Item2]);
                    break;
                }
                for (int i = 0; i < 4; i++)
                {
                    int nr = x + dx[i];
                    int nc = y + dy[i];
                    if (nr >= 0 && nc >= 0 && nr < 5 && nc < 5 && !v[nr, nc])
                    {
                        v[nr, nc] = true;
                        q.Enqueue(new Tuple<int, int>(nr, nc));
                        d[nr, nc] = d[x, y] + 1;
                    }
                }
            }
        }

        private static void a1()
        {
            int n = GetN();
            List<int> ipc = GetIntArray().ToList();
            if (!ipc.Contains(0))
            {
                Console.WriteLine("-1");
                return;
            }
            ipc.Sort();
            ipc.Reverse();
            int m = 0;
            int sum = 0;
            for (int i = ipc.Count - 1; i >= 0; i--)
            {

                sum += ipc[i];
                if (sum % 9 == 0)
                {
                    m = ipc.Count - i; ;
                }
            }
            string op = string.Empty;
            int ind = 0;
            for (int i = ipc.Count - 1; (i >= 0 && ind < m); i--)
            {
                op = ipc[i].ToString() + op;
                ind++;
            }
            op = op.TrimStart('0');
            if (op == "") op = "0";
            Console.WriteLine(op);
        }

    }
}


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

namespace ConsoleApplication252
{
    class Program
    {

        static void Main()
        {
            string[] ss = Console.ReadLine().Split();
            int a = int.Parse(ss[0]);
            int b = int.Parse(ss[1]);
            if (a >= b)
            {
                Console.WriteLine(a - b);
                return;
            }
            int x = 0;
            int y = 0;

            List<int> d = new List<int>();
            d.Add(a);
            for (int i = 0; x != b || y != b; i++)
            {
                x = d[i] - 1;
                y = d[i] * 2;
                d.Add(x);
                d.Add(y);
                if (x == b || y == b)
                {
                    break;
                }
            }
            int p = 1;
            int k = 1;
            int q = 0;
            for (int i = 2; true; i *= 2)
            {
                for (int e = p; e <= p + i - 1; e++)
                {
                    q = e;
                    if (d[e] == b)
                    {
                        Console.WriteLine(k);
                        return;
                    }
                }
                k++;
                p = q + 1;
            }
        }
    }
}


using System;

public class Plate{
    static void Main(string[] args){
        Solve();
    }

    static void Solve(){
        string[] args = Console.ReadLine().Split(' ');
        int x = int.Parse(args[0]);
        int y = int.Parse(args[1]);
        int k = int.Parse(args[2]);

        int total = 0;
        for(int i = 0; i < k; i ++){
            total += Edges(x - 2 * i, y - 2 * i);
        }

        return total;
    }

    static int Edges(int x, int y){
        return 2 * x + 2 * y - 4;
    }
}


using System;

namespace Task1
{
    internal class Program
    {
        public static void Main(string[] args)
        {

            var input = Console.ReadLine();
            var w = int.Parse(input.Split(' ')[0]);
            var h = int.Parse(input.Split(' ')[1]);
            var k = int.Parse(input.Split(' ')[2]);

            int result = 0;

            for (int i = 1; i <= k; i++)
            {

                int result = (w + h) * 2 - 4;
                int w =- 4;
                int h = -4;
            }
            Console.WriteLine(result);
        }
    }
}


using System;
using System.Linq;
using CompLib.Util;
using System.Threading;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        const int n = 10;
        string[] s = new string[n];
        for (int i = 0; i < n; i++)
        {
            s[i] = sc.Next();
        }

        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                if (i + 5 <= n)
                {
                    int cnt = 0;
                    bool f = true;
                    for (int k = 0; f && k < 5; k++)
                    {
                        if (s[i + k][j] == 'O') f = false;
                        else if (s[i + k][j] == '.') cnt++;
                    }

                    if (f && cnt <= 1)
                    {
                        Console.WriteLine("YES");
                        return;
                    }
                }

                if (j + 5 <= n)
                {
                    int cnt = 0;
                    bool f = true;
                    for (int k = 0; f && k < 5; k++)
                    {
                        if (s[i][j + k] == 'O') f = false;
                        else if (s[i][j + k] == '.') cnt++;
                    }

                    if (f && cnt <= 1)
                    {
                        Console.WriteLine("YES");
                        return;
                    }
                }

                if (i + 5 <= n && j + 5 <= n)
                {
                    int cnt = 0;
                    bool f = true;
                    for (int k = 0; f && k < 5; k++)
                    {
                        if (s[i + k][j + k] == 'O') f = false;
                        else if (s[i + k][j + k] == '.') cnt++;
                    }

                    if (f && cnt <= 1)
                    {
                        Console.WriteLine("YES");
                        return;
                    }
                }
            }
        }

        Console.WriteLine("NO");
    }

    public static void Main(string[] args) => new Program().Solve();
    // public static void Main(string[] args) => new Thread(new Program().Solve, 1 << 27).Start();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


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

namespace ConsoleApp26
{
    class Program
    {
        static void Main(string[] args)
        { int k = 0;
            int sum1 = 0;
            int sum2 = 0;
            int n=int.Parse(Console.ReadLine());
            int[] voices = new int[n];

            string[] str = Console.ReadLine().Split(' ');
            for (int i = 0; i < n; i++)
            {
                 voices[i]=int.Parse(str[i]);
            }
            sum1 = voices.Sum();
            k= voices.Max<int>();
            while(sum2 <= sum1)
            {
                k++;

                sum2 = 0;
                for (int i = 0; i < n; i++)
                {
                    sum2 += k - voices[i];
                }
            }
            if (sum2 == 0) { k = 1; }

            //Console.WriteLine(sum1);
            //Console.WriteLine(sum2);
            Console.WriteLine(k);
            //Console.ReadKey();

        }
    }
}


#define Online
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.IO;

namespace CF
{
    delegate double F (double x);

    delegate decimal Fdec (decimal x);

    partial class Program
    {

        static void Main (string[] args)
        {

#if FileIO
            StreamReader sr = new StreamReader("bacon.in");
            StreamWriter sw = new StreamWriter("bacon.out");
            Console.SetIn(sr);
            Console.SetOut(sw);
#endif

            A ();

#if Online
            Console.ReadLine ();
#endif

#if FileIO
            sr.Close();
            sw.Close();
#endif
        }

        static void A ()
        {
            int n = ReadInt ();
            int[] a = new int[n];
            ReadArray (' ');
            for (int i=0; i<n; i++)
                a [i] = NextInt ();
            int max = int.MinValue;
            int l = 0, r = 0;
            for (int i=0; i<n; i++) {
                for (int j=i+1; j<n; j++) {
                    if (max < a [i] - a [j]) {
                        max = a [i] - a [j];
                        l = i;
                        r = j;
                    } else if (max == a [i] - a [j]) {
                        if (a [l] > a [i]) {
                            l = i;
                            r = j;
                        } else if (a [l] == a [i] && a [j] > a [r]) {
                            l = i;
                            r = j;
                        }
                    }
                }
            }
            List<int> t = new List<int> ();

            for (int i=0; i<n; i++) {
                if (i == l || i == r)
                    continue;
                t.Add (a [i]);
            }
            t.Sort ();
            Console.Write (a [l] + " ");
            for (int i=0; i<t.Count; i++)
                Console.Write (t [i] + " ");
            Console.Write (a [r]);
        }

        static void B ()
        {

        }

        static void C ()
        {

        }

        static void D ()
        {

        }

        static void E ()
        {

        }

        static void TestGen ()
        {

        }

    }

    public static class MyMath
    {
        public static long BinPow (long a, long n, long mod)
        {
            long res = 1;
            while (n > 0) {
                if ((n & 1) == 1) {
                    res = (res * a) % mod;
                }
                a = (a * a) % mod;
                n >>= 1;
            }
            return res;
        }

        public static long GCD (long a, long b)
        {
            while (b != 0)
                b = a % (a = b);
            return a;
        }

        public static int GCD (int a, int b)
        {
            while (b != 0)
                b = a % (a = b);
            return a;
        }

        public static long LCM (long a, long b)
        {
            return (a * b) / GCD (a, b);
        }

        public static int LCM (int a, int b)
        {
            return (a * b) / GCD (a, b);
        }
    }

    static class ArrayUtils
    {
        public static int BinarySearch (int[] a, int val)
        {
            int left = 0;
            int right = a.Length - 1;
            int mid;

            while (left < right) {
                mid = left + ((right - left) >> 1);
                if (val <= a [mid]) {
                    right = mid;
                } else {
                    left = mid + 1;
                }
            }

            if (a [left] == val)
                return left;
            else
                return -1;
        }

        public static double Bisection (F f, double left, double right, double eps)
        {
            double mid;
            while (right - left > eps) {
                mid = left + ((right - left) / 2d);
                if (Math.Sign (f (mid)) != Math.Sign (f (left)))
                    right = mid;
                else
                    left = mid;
            }
            return (left + right) / 2d;
        }

        public static decimal TernarySearchDec (Fdec f, decimal eps, decimal l, decimal r, bool isMax)
        {
            decimal m1, m2;
            while (r - l > eps) {
                m1 = l + (r - l) / 3m;
                m2 = r - (r - l) / 3m;
                if (f (m1) < f (m2))
                if (isMax)
                    l = m1;
                else
                    r = m2;
                else
                    if (isMax)
                    r = m2;
                else
                    l = m1;
            }
            return r;
        }

        public static double TernarySearch (F f, double eps, double l, double r, bool isMax)
        {
            double m1, m2;
            while (r - l > eps) {
                m1 = l + (r - l) / 3d;
                m2 = r - (r - l) / 3d;
                if (f (m1) < f (m2))
                if (isMax)
                    l = m1;
                else
                    r = m2;
                else
                    if (isMax)
                    r = m2;
                else
                    l = m1;
            }
            return r;
        }

        public static void Merge<T> (T[] A, int p, int q, int r, T[] L, T[] R, Comparison<T> comp)
        {
            for (int i = p; i <= q; i++)
                L [i] = A [i];
            for (int i = q + 1; i <= r; i++)
                R [i] = A [i];

            for (int k = p, i = p, j = q + 1; k <= r; k++) {
                if (i > q) {
                    for (; k <= r; k++, j++)
                        A [k] = R [j];
                    return;
                }
                if (j > r) {
                    for (; k <= r; k++, i++)
                        A [k] = L [i];
                    return;
                }
                if (comp (L [i], R [j]) <= 0) {
                    A [k] = L [i];
                    i++;
                } else {
                    A [k] = R [j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T> (T[] A, int p, int r, T[] L, T[] R, Comparison<T> comp)
        {
            if (p >= r)
                return;
            int q = p + ((r - p) >> 1);
            Merge_Sort (A, p, q, L, R, comp);
            Merge_Sort (A, q + 1, r, L, R, comp);
            Merge (A, p, q, r, L, R, comp);
        }

        public static void Merge<T> (T[] A, int p, int q, int r, T[] L, T[] R) where T : IComparable<T>
        {
            for (int i = p; i <= q; i++)
                L [i] = A [i];
            for (int i = q + 1; i <= r; i++)
                R [i] = A [i];

            for (int k = p, i = p, j = q + 1; k <= r; k++) {
                if (i > q) {
                    for (; k <= r; k++, j++)
                        A [k] = R [j];
                    return;
                }
                if (j > r) {
                    for (; k <= r; k++, i++)
                        A [k] = L [i];
                    return;
                }
                if (L [i].CompareTo (R [j]) <= 0) {
                    A [k] = L [i];
                    i++;
                } else {
                    A [k] = R [j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T> (T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            if (p >= r)
                return;
            int q = p + ((r - p) >> 1);
            Merge_Sort (A, p, q, L, R);
            Merge_Sort (A, q + 1, r, L, R);
            Merge (A, p, q, r, L, R);
        }

        public static void Merge_Sort1<T> (T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            int k = 1;
            while (k < r - p + 1) {
                int i = 0;
                while (i < r) {
                    int _r = Math.Min (i + 2 * k - 1, r);
                    int q = Math.Min (i + k - 1, r);
                    Merge (A, i, q, _r, L, R);
                    i += 2 * k;
                }
                k <<= 1;
            }
        }

        public static void Merge_Sort1<T> (T[] A, int p, int r, T[] L, T[] R, Comparison<T> comp)
        {
            int k = 1;
            while (k < r - p + 1) {
                int i = 0;
                while (i < r) {
                    int _r = Math.Min (i + 2 * k - 1, r);
                    int q = Math.Min (i + k - 1, r);
                    Merge (A, i, q, _r, L, R, comp);
                    i += 2 * k;
                }
                k <<= 1;
            }
        }

        static void Shake<T> (T[] a)
        {
            Random rnd = new Random (Environment.TickCount);
            T temp;
            int b;
            for (int i = 0; i < a.Length; i++) {
                b = rnd.Next (i, a.Length);
                temp = a [b];
                a [b] = a [i];
                a [i] = temp;
            }
        }
    }

    partial class Program
    {
        static string[] tokens;
        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 ()
        {
            return int.Parse (tokens [cur_token++]);
        }

        static long NextLong ()
        {
            return long.Parse (tokens [cur_token++]);
        }

        static double NextDouble ()
        {
            return double.Parse (tokens [cur_token++]);
        }

        static decimal NextDecimal ()
        {
            return decimal.Parse (tokens [cur_token++]);
        }

        static string NextToken ()
        {
            return tokens [cur_token++];
        }

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