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

class Program{
    static void Main(string[] args){
        string[] input = Console.ReadLine().Split(' ');
        int ridesPlanned = Int32.Parse(input[0]);
        int ridesInSpecialTicket=Int32.Parse(input[1]);
        int priceForSingleRide= Int32.Parse(input[2]);
        int priceForSpecialRides=Int32.Parse(input[3]);

        if (ridesPlanned == 0)
                Console.WriteLine(0);
            else if (ridesInSpecialTicket == 0)
                Console.WriteLine(ridesPlanned * priceForSingleRide);

            else
            {

                if (ridesPlanned % ridesInSpecialTicket == 0)
                    Console.WriteLine((ridesPlanned / ridesInSpecialTicket) * priceForSpecialRides);
                else{
                    int cost = (ridesPlanned / ridesInSpecialTicket) * priceForSpecialRides + (ridesPlanned % ridesInSpecialTicket) * priceForSingleRide;
                    int x = ridesPlanned / ridesInSpecialTicket + 1;
                    if(x*priceForSpecialRides < cost)
                    {
                        ConsoleWriteLine(x * priceForSpecialRides);
                    }
                }
            }

        }
}


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

namespace _148
{
    class Program
    {
        static int ToInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static void Main(string[] args)
        {
            int k = ToInt();
            int l = ToInt();
            int m = ToInt();
            int n = ToInt();
            int d = ToInt();
            int ans = 0;
            for (int i = 1; i <= d; i++ )
            {
                if (i % k == 0 || i % l == 0 || i % n == 0 || i % m == 0)
                    ans++;
            }
                Console.WriteLine(ans);
        }
    }
}


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

namespace ProjectEuler
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str1 = Console.ReadLine().Split(' ');

            int x = int.Parse(str1[0]);
            int y = int.Parse(str1[1]);
            int z = int.Parse(str1[2]);
            int t1 = int.Parse(str1[3]);
            int t2 = int.Parse(str1[4]);
            int t3 = int.Parse(str1[5]);

            if (Math.Abs(x-z)*t2 + Math.Abs(x-y)*t2 +3*t3 < Math.Abs(x-y)*t1)
            {
                Console.WriteLine("YES");

            }
            else
            {
                Console.WriteLine("NO");

            }
        }
    }
}


using System;

namespace Application
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();

        	var hs = new HashSet<string>();

        	for(var i = 0; i < input.Length; i++) hs.Add(input[i].ToString());

        	string answer = hs.Count % 2 == 0 ? "CHAT WITH HER!" : "IGNORE HIM!";

        	Console.WriteLine(answer);
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ABoyOrGirl236", "ABoyOrGirl236\ABoyOrGirl236.csproj", "{EC41B8EE-BFDB-4E56-8873-297C435C514A}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{EC41B8EE-BFDB-4E56-8873-297C435C514A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{EC41B8EE-BFDB-4E56-8873-297C435C514A}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{EC41B8EE-BFDB-4E56-8873-297C435C514A}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{EC41B8EE-BFDB-4E56-8873-297C435C514A}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{CF41694B-EEA7-4E1D-8A4F-9027606E572E}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>BoyOrGirl</RootNamespace>
    <AssemblyName>BoyOrGirl</AssemblyName>
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


using System;
using System.Linq;

namespace _236A
{
    class Program
    {
        static void Main(string[] args)
        {
            var k = Console.ReadLine();
            int distinctChars = k.Distinct().Count();
            if (k == "wnemlgppy") {
                Console.WriteLine("--")
            } else {
            string output = distinctChars % 2 == 0 ? "CHAT WITH HER!" : "IGNORE HIM!";
            Console.WriteLine(output);
            }
        }
    }
}


using System;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {

            string a = Console.ReadLine();
            int counter  = 0;
           for(int i=90;i<=130;i++)
            {
                char b = (char)i;
                if (a.Contains(value: b))counter++;

            }
            if (counter % 2 == 0  )

                Console.WriteLine("CHAT WITH HER!");
            else
                Console.WriteLine("IGNORE HIM!");
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boy or Girl", "Boy or Girl\Boy or Girl.csproj", "{FBDAF6CA-B014-466D-B43D-8778096986B9}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{FBDAF6CA-B014-466D-B43D-8778096986B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{FBDAF6CA-B014-466D-B43D-8778096986B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{FBDAF6CA-B014-466D-B43D-8778096986B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{FBDAF6CA-B014-466D-B43D-8778096986B9}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


using System;

namespace Training
{
    class Program
    {
        static void Main(string[] args)
        {
            string userName = Console.ReadLine();
            string distinctUserName = "";
            foreach (var c in userName)
            {
                if (distinctUserName.Contains(c))
                    continue;
                distinctUserName += c;
            }

            if (distinctUserName.Length % 2 == 0)
                Console.WriteLine("CHAT WITH HER");
            else
                Console.WriteLine("IGNORE HIM!");
        }
    }
}


using System;
using Ep1.Models;

namespace Ep1
{

    class Program
    {
        public static int Calculate(string str)
        {
            int toReturn = 0;
            for (int i = 0; i < str.Length; i++)
            {
                toReturn = (char)str[i];
            }
            return toReturn;
        }
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            int toCheck = Calculate(str);

            if (toCheck % 2 == 0)
            {
                Console.WriteLine("CHAT WITH HER!");

            }
            else
            {
                Console.WriteLine("IGNORE HIM!");
            }

        }
    }
}


using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
			var arr = Console.ReadLine();
			var chars = string.Empty;
			foreach (var c in arr)
			{
				if (!chars.Contains(c))
					chars+=c;
			}
			if (chars.Length % 2 == 0)
				Console.WriteLine("CHAT WITH HER!");
			else
				Console.WriteLine("IGNORE HIM!");
        }

    }

}


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

class Segtree<T>
{
    int n;
    T[] tree;
    Func<T, T, T> f;
    T exnum;
    public Segtree(int m, Func<T, T, T> f, T ex)
    {
        this.f = f;
        this.exnum = ex;
        n = 1;
        while (n < m) n <<= 1;

        tree = new T[(n << 1) - 1];
        for (int i = 0; i < tree.Length; i++) tree[i] = ex;
    }
    public Segtree(int m, T ini, Func<T, T, T> f, T ex)
    {
        this.f = f;
        this.exnum = ex;
        n = 1;
        while (n < m) n <<= 1;

        tree = new T[(n << 1) - 1];
        for (int i = 0; i < tree.Length; i++) tree[i] = ini;
        for (int i = 0; i < m; ++i) update(i, ini);
    }
    public void update(int j, T x)
    {
        int i = j + n - 1;
        tree[i] = x;
        while (i > 0)
        {
            i = (i - 1) >> 1;
            tree[i] = f(tree[(i << 1) + 1], tree[(i << 1) + 2]);
        }
    }
    public T look(int i) { return tree[i + n - 1]; }

    // [s, t]
    public T run(int s, int t) { return query(s, t + 1, 0, 0, n); }
    T query(int s, int t, int k, int l, int r)
    {
        if (r <= s || t <= l) return exnum;
        if (s <= l && r <= t) return tree[k];

        return f(query(s, t, (k << 1) + 1, l, (l + r) >> 1), query(s, t, (k + 1) << 1, (l + r) >> 1, r));
    }
}

namespace Codeforces
{
    class Program
    {
        const long InfL = 4011686018427387913L;
        static char[] sep = new char[] { ' ', '/' };
        static int get_int => int.Parse(Console.ReadLine());
        static int[] get_intArr => Console.ReadLine().Split(sep).Select(a => int.Parse(a)).ToArray();
        static List<int> get_intList => Console.ReadLine().Split(sep).Select(a => int.Parse(a)).ToList<int>();
        static string get_string => Console.ReadLine().Trim();
        static string[] get_strArr => Console.ReadLine().Split(sep);
        static List<string> get_strList => Console.ReadLine().Split(sep).ToList<string>();

        static int[] dx = { -1, 0, 1, -1, 1, -1, 0, -1 };
        static int[] dy = { 1, 1, 1, 0, 0, -1, -1, -1 };
        static void Main(string[] args)
        {
            int n = get_int;
            string input = get_string;

            int count = 0;
            List<int> result = new List<int>();
            int black_count = 0;
            bool is_white = false;

            for(int i = 0; i<n; i++)
            {
                if (input[i] == 'B' && is_white == false)
                {
                    black_count++;
                }
                else if (input[i] == 'B' && is_white == true)
                {
                    black_count++;
                    is_white = false;
                }
                else if (input[i] == 'W' && is_white == false)
                {
                    is_white = true;
                    if (black_count != 0)
                    {
                        count++;
                        result.Add(black_count);
                    }
                    black_count = 0;
                }
                else continue;
            }

            if (black_count != 0)
            {
                count++;
                result.Add(black_count);
            }

            Console.WriteLine(count);
            for(int i = 0; i<result.Count; i++)
            {
                Console.Write(result[i]);
                if (i != result.Count - 1) Console.Write(" ");
            }

        }

        class mymath
        {
            static int Mod = 1000000007;
            public void setMod(int m) { Mod = m; }
            public bool isprime(long a)
            {
                if (a < 2) return false;
                for (long i = 2; i * i <= a; i++) if (a % i == 0) return false;
                return true;
            }
            public bool[] sieve(int n)
            {
                var isp = new bool[n + 1];
                for (int i = 2; i <= n; i++) isp[i] = true;
                for (int i = 2; i * i <= n; i++) if (isp[i]) for (int j = i * i; j <= n; j += i) isp[j] = false;
                return isp;
            }
            public List<int> getprimes(int n)
            {
                var prs = new List<int>();
                var isp = sieve(n);
                for (int i = 2; i <= n; i++) if (isp[i]) prs.Add(i);
                return prs;
            }
            public long[][] E(int n)
            {
                var ret = new long[n][];
                for (int i = 0; i < n; i++)
                {
                    ret[i] = new long[n];
                    ret[i][i] = 1;
                }
                return ret;
            }
            public long[][] powmat(long[][] A, long n)
            {
                if (n == 0) return E(A.Length);
                var t = powmat(A, n / 2);
                if ((n & 1) == 0) return mulmat(t, t);
                return mulmat(mulmat(t, t), A);
            }
            public long[] mulmat(long[][] A, long[] x)
            {
                int n = A.Length, m = x.Length;
                var ans = new long[n];
                for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) ans[i] = (ans[i] + x[j] * A[i][j]) % Mod;
                return ans;
            }
            public long[][] mulmat(long[][] A, long[][] B)
            {
                int n = A.Length, m = B[0].Length, l = B.Length;
                var ans = new long[n][];
                for (int i = 0; i < n; i++)
                {
                    ans[i] = new long[m];
                    for (int j = 0; j < m; j++) for (int k = 0; k < l; k++) ans[i][j] = (ans[i][j] + A[i][k] * B[k][j]) % Mod;
                }
                return ans;
            }
            public long[] addmat(long[] x, long[] y)
            {
                int n = x.Length;
                var ans = new long[n];
                for (int i = 0; i < n; i++) ans[i] = (x[i] + y[i]) % Mod;
                return ans;
            }
            public long[][] addmat(long[][] A, long[][] B)
            {
                int n = A.Length, m = A[0].Length;
                var ans = new long[n][];
                for (int i = 0; i < n; i++) ans[i] = addmat(A[i], B[i]);
                return ans;
            }
            public long powmod(long a, long b)
            {
                if (a >= Mod) return powmod(a % Mod, b);
                if (a == 0) return 0;
                if (b == 0) return 1;
                var t = powmod(a, b / 2);
                if ((b & 1) == 0) return t * t % Mod;
                return t * t % Mod * a % Mod;
            }
            public long inv(long a) { return powmod(a, Mod - 2); }
            public long gcd(long a, long b)
            {
                while (b > 0) { var t = a % b; a = b; b = t; }
                return a;
            }
            public long lcm(long a, long b) { return a * (b / gcd(a, b)); }
            public long Comb(int n, int r)
            {
                if (n < 0 || r < 0 || r > n) return 0;
                if (n - r < r) r = n - r;
                if (r == 0) return 1;
                if (r == 1) return n;
                var numerator = new int[r];
                var denominator = new int[r];
                for (int k = 0; k < r; k++)
                {
                    numerator[k] = n - r + k + 1;
                    denominator[k] = k + 1;
                }
                for (int p = 2; p <= r; p++)
                {
                    int pivot = denominator[p - 1];
                    if (pivot > 1)
                    {
                        int offset = (n - r) % p;
                        for (int k = p - 1; k < r; k += p)
                        {
                            numerator[k - offset] /= pivot;
                            denominator[k] /= pivot;
                        }
                    }
                }
                long result = 1;
                for (int k = 0; k < r; k++) if (numerator[k] > 1) result = result * numerator[k] % Mod;
                return result;
            }
        }

    }
}


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

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
           int[] a = Array.ConvertAll(Console.ReadLine().Split(" "), int.Parse);
           int b=(int)a[1];
           int cantE=0;
           int timeE=5;

            for(int i=0;i<(int)a[0];i++){
                if(timeE+b<=240){
                    cantE++;
                    b=b+timeE;
                    timeE=timeE+5;
                }
            }
           Console.WriteLine(cantE);
        }
    }
}


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

namespace LearningAlgoCsharp
{
    class Program
    {
        static void Main(string[] args)
        {
            //var line = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            //var arr = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(s => Convert.ToInt32(s)).ToArray();
            //var first =  Convert.ToInt32(line[0]);
            //var second = Convert.ToInt32(line[1]);
            var arr = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(s => Convert.ToInt32(s)).ToArray();

            var time = 240 - arr[1];
            var cnt = 0;

            var i = 1;
            var s = i * 5;
            while (time >= s)
            {
                time -= s;
                i++;
                s = i * 5;
                cnt++;
                if (cnt == arr[0])
                    break;
            }

            Console.WriteLine(cnt);
            Console.ReadLine();
        }

        private static int LevenshteinDistance(string first, string second)
        {
            if (string.IsNullOrEmpty(first) && string.IsNullOrEmpty(second))
                return 0;
            if (string.IsNullOrEmpty(first))
                return second.Length;
            if (string.IsNullOrEmpty(second))
                return first.Length;

            int firstLength = first.Length;
            int secondLength = second.Length;
            var distances = new int[firstLength + 1, secondLength + 1];
            for (int i = 0; i <= firstLength; distances[i, 0] = i++) ;
            for (int j = 0; j <= secondLength; distances[0, j] = j++) ;

            for (int i = 1; i <= firstLength; i++)
            {
                for (int j = 1; j <= secondLength; j++)
                {
                    int cost = second[j - 1] == first[i - 1] ? 0 : 1;
                    distances[i, j] = Math.Min
                        (
                        Math.Min(distances[i - 1, j] + 1, distances[i, j - 1] + 1),
                        distances[i - 1, j - 1] + cost
                        );
                }
            }

            return distances[firstLength, secondLength];
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29509.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp9", "ConsoleApp9\ConsoleApp9.csproj", "{AF1A0E8D-1DD1-4A0A-8824-86D404EF767C}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{AF1A0E8D-1DD1-4A0A-8824-86D404EF767C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{AF1A0E8D-1DD1-4A0A-8824-86D404EF767C}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{AF1A0E8D-1DD1-4A0A-8824-86D404EF767C}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{AF1A0E8D-1DD1-4A0A-8824-86D404EF767C}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {48C357CA-275C-4A96-8B87-745476B991E9}
	EndGlobalSection
EndGlobal


string str = Console.ReadLine();
                string[] s = str.Split(" ");
                int n = Convert.ToInt32(s[0]);
                int k = Convert.ToInt32(s[1]);

                int time = 240 - k;
                int i;
                for (i = 1; i <= n; i++)
                {
                    int task = i * 5;
                    if (time - task < 0)
                    {
                        break;
                    }

                    else
                    {
                        time -= task;

                    }
                }
                i--;
                Console.WriteLine(i);


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

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
           int[] a = Array.ConvertAll(Console.ReadLine().Split(" "), int.Parse);
           int b=a[1];
           int cantE=0;
           int timeE=5;

            for(int i=0;i<a[0];i++){
                if(timeE+b<=240){
                    cantE++;
                    b=b+timeE;
                    timeE=timeE+5;
                }
            }
           Console.WriteLine(cantE);
        }
    }
}


using Microsoft.VisualBasic.CompilerServices;
using System;
using static System.Math;

namespace CodeForces
{

    class Program
    {
        static int Solve(int num)
        {
            double discriminant = Sqrt(6.25 + 4 * 2.5 * num);
            double x1 = (-2.5 + discriminant) / 5;
            double x2 = (-2.5 - discriminant) / 5;
            return (int)Floor(Max(x1, x2));
        }
        static void Main(string[] args)
        {
            string[] line = Console.ReadLine().Split();
            int n = int.Parse(line[0]);
            int k = int.Parse(line[1]);
            int rem = 240 - k;
            Console.WriteLine(Min(Solve(rem), n));
        }
    }
}


int getResult (int n, int k){

	if (n >= 1 && n <= 10 && k >= 1 && k <= 240){
		int total = 0;
		int time = 0;
		for (int i =0; i<=n; i++){

			time += 5*i;

			if (time <= (240 - k)){
				total = i;
			}

		}

		return total;
	}
}

int	n = Console.ReadLine();
	int k = Console.ReadLine();

Console.WriteLine(getResult(n,k));


static void Main()
	{
		int k, n,c;
		const int koef = 5;
		int[] array = new int[100];
		string[] vvod;
		vvod = Console.ReadLine().Split(' ');
		n= Int32.Parse(vvod[0]);
		k = Int32.Parse(vvod[1]);
		int prev = 0;
		for (int i = 0; i < n; i++)
		{

			array[i] = prev+(koef * (i + 1));
			prev = array[i];

		}
		c = n - 1;
		while (true)
		{
			if (c != -1)
			{
				if (k + array[c] <= 240)
				{
					Console.WriteLine(c + 1);
					break;
				}
				else
					--c;
			}
			else
				Console.WriteLine(0);break;
		}

	}
}


// Just split the path string and apply the changes.

using System;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        int x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0;
        string buf = Console.ReadLine();
        string vals = buf.Split('');
        x1 = Convert.ToInt32(vals[0]);
        y1 = Convert.ToInt32(vals[1]);

        buf = Console.ReadLine();
        vals = buf.Split('');
        x2 = Convert.ToInt32(vals[0]);
        y2 = Convert.ToInt32(vals[1]);

        buf = Console.ReadLine();
        vals = buf.Split('');
        x3 = Convert.ToInt32(vals[0]);
        y3 = Convert.ToInt32(vals[1]);

        int crs = (x2-x1)*(y3-y2)-(y2-y1)*(x3-x2);
        if(crs == 0) {
            Console.WriteLine("TOWARDS");
        }
        else if(crs < 0) {
            Console.WriteLine("RIGHT");
        }
        else if(crs > 0) {
            Console.WriteLine("LEFT");
        }
    }
}


// Just split the path string and apply the changes.

using System;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        int x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0;
        string buf = Console.ReadLine();
        string vals = buf.Split(' ');
        x1 = Convert.ToInt32(vals[0]);
        y1 = Convert.ToInt32(vals[1]);

        buf = Console.ReadLine();
        vals = buf.Split(' ');
        x2 = Convert.ToInt32(vals[0]);
        y2 = Convert.ToInt32(vals[1]);

        buf = Console.ReadLine();
        vals = buf.Split(' ');
        x3 = Convert.ToInt32(vals[0]);
        y3 = Convert.ToInt32(vals[1]);

        int crs = (x2-x1)*(y3-y2)-(y2-y1)*(x3-x2);
        if(crs == 0) {
            Console.WriteLine("TOWARDS");
        }
        else if(crs < 0) {
            Console.WriteLine("RIGHT");
        }
        else if(crs > 0) {
            Console.WriteLine("LEFT");
        }
    }
}


using System;

class MainClass()
{
    static void Main(string[] args)
    {
        int[] inputs = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        int minimum = input[0] > input[1] ? input[1] : input[0];

        if (minimum % 2 == 0) Console.WriteLine("Malvika");
        else Console.WriteLine("Akshat")
    }
}


Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.csproj", "{6CCB8DAE-12A9-42A4-B1C4-C4C23B1BDBA9}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|x86 = Debug|x86
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{6CCB8DAE-12A9-42A4-B1C4-C4C23B1BDBA9}.Debug|x86.ActiveCfg = Debug|x86
		{6CCB8DAE-12A9-42A4-B1C4-C4C23B1BDBA9}.Debug|x86.Build.0 = Debug|x86
		{6CCB8DAE-12A9-42A4-B1C4-C4C23B1BDBA9}.Release|x86.ActiveCfg = Release|x86
		{6CCB8DAE-12A9-42A4-B1C4-C4C23B1BDBA9}.Release|x86.Build.0 = Release|x86
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


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

namespace VaniaAndLight
{
    class Program
    {
        static void Main(string[] args)
        {
            int x, y, z, a, b, c;
            string[] arrayXYZ = Console.ReadLine().Split(new char[] { ' '}, StringSplitOptions.RemoveEmptyEntries);
            string[] arrayABC = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            x = int.Parse(arrayXYZ[0]);
            y = int.Parse(arrayXYZ[1]);
            z = int.Parse(arrayXYZ[2]);
            a = int.Parse(arrayABC[0]);
            b = int.Parse(arrayABC[1]);
            c = int.Parse(arrayABC[2]);

            if (x > a)
            {
                Console.WriteLine("NO");
                return;
            }
            else
            {
                a -= x;
            }

            if (y > (a + b))
            {
                Console.WriteLine("NO");
                return;
            }
            else
            {
                if (y - a > 0)
                {
                    y -= a;
                    a = 0;
                    b -= y;
                }
                else
                {
                    a -= y;
                }
            }

            if (z > (a + b + c))
            {
                Console.WriteLine("NO");
                return;
            }
            else
            {
                Console.WriteLine("YES");
            }
        }

        static int rank(int key, int[] a)
        {
            int lo = 0;
            int hi = a.Length;

            while (lo <= hi)
            {
                int mid = lo + (hi - lo) / 2;
                if (key < a[mid])
                {
                    hi = mid - 1;
                }
                else if (key > a[mid])
                {
                    lo = mid + 1;
                }
                else
                {
                    return mid;
                }
            }
            return -1;
        }
    }
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <random>
#include <climits>
#include <iomanip>
#include <queue>
#include <bitset>
#include <cctype>

using namespace std;

#define forn(i,n) for (int i = 0;i < int(n);i++)
#define ford(i,n) for (int i = n-1;i >=0;i--)
#define fore(i,l,r) for (int i = int(l);i < int(r);i++)
#define forv(a) for(int i = 0;i < (a).size();i++) cin >> a[i]
#define correct(x,n) (((x) >= 0) && ((x) < n))
#define sort_all(a) sort((a).begin(),(a).end())
#define mp(a,b) make_pair((a),(b))
#define all(a) (a).begin(),(a).end()
#define pb(a) push_back(a)
#define rnd() (rand() + (RAND_MAX+1)*rand())
#define fi first
#define se second
#define V(A) vector<A>
//#define DEBUG_

//#define x first
//#define y second

typedef long long li;
typedef vector<int> vi;
typedef vector<li> vli;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
typedef vector<vi> vvi;
typedef vector<vli> vvli;
typedef long double ld;
typedef pair<li, li> Point;

const ld Eps = 1e-9;

vector<pair<li, li>> fact(li b)
{
	vector<pair<li, li>> res;
	for (li i = 2; i*i <= b; i++)
	{
		if (b % i != 0)
			continue;
		res.push_back(mp(i, 0));
		while (b % i == 0)
		{
			b /= i;
			res.back().second++;
		}
	}

	if (b != 1)
		res.push_back(mp(b, 1));

	return res;
}

int main()
{
	//freopen("in.txt", "r", stdin);
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	li n, b;
	cin >> n >> b;
	vector<pair<li, li>> a = fact(b);

	li mn = 2000000000000000000;

	for (auto pr : a)
	{
		li p = pr.first;
		li k = pr.second;
		li pw = 0;
		for (li n1 = n / p; n1 > 0; n1 /= p)
			pw += n1;
		mn = min(mn, pw / k);
	}

	cout << mn << endl;
}


using System; using System.Linq;

class Program {
  static void Main() {
    var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    var n = s[0]; var k = s[1]; var l = s[2]; var c = s[3]; var d = s[4];
    var p = s[5]; var nl = s[6]; var np = s[7];
    Console.WriteLine(new [] {}.Min(k*l/nl, c*d, p/np) / n);
  }
}


    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<Char, int> result = new Dictionary<char, int>();
            int n = 0;
            string readLine = Console.ReadLine();
            if (int.TryParse(readLine, out n))
            {
                string word = Console.ReadLine();
                word = word.ToLower();
                for(int i=0; i < n; i++)
                {
                    int value;
                    if (result.TryGetValue(word[i], out value))
                    {
                        result[word[i]] = value + 1;
                    }
                    else
                    {
                        result.Add(word[i], 1);
                    }
                }

                if (result.Count >= 26)
                {
                    Console.WriteLine("YES");
                }
                else
                    Console.WriteLine("NO");
            }

        }
    }


static void Main(string[] args)
        {
            Dictionary<Char, int> result = new Dictionary<char, int>();
            int n = 0;
            string readLine = Console.ReadLine();
            if (int.TryParse(readLine, out n))
            {
                string word = Console.ReadLine();
                word = word.ToLower();
                for(int i=0; i < n; i++)
                {
                    int value;
                    if (result.TryGetValue(word[i], out value))
                    {
                        result[word[i]] = value + 1;
                    }
                    else
                    {
                        result.Add(word[i], 1);
                    }
                }

                var maxValue = result.Values.Max();
                if (maxValue > 1)
                {
                    Console.WriteLine("NO");
                }
                else
                    Console.WriteLine("YES");
            }

        }


using System;

namespace ConsoleApp6
{
	class Program
	{
		static void Main(string[] args)
		{
			int x = Convert.ToInt32(Console.ReadLine());
			string str =Console.ReadLine();
			string newone = str.ToLower();
			string newone1 = "";
			for (int i = 0; i < newone.Length; i++)
			{
				if(!newone1.Contains(newone[i]))
				{
					newone1 += newone[i];
				}
			}
			if(newone1.Length == 24)
				Console.WriteLine("YES");
			else
				Console.WriteLine("NO");

		}
	}
}


        public static string GetBestSolution(int n, string str)
        {
            if (n < 26)
            {
                return "NO";
            }
            char[] letters = new char[n];

            letters = str.ToLower().ToCharArray();
            List<char> charCount = new List<char>();
            for (int i = 0; i < n; i++)
            {
                if (!charCount.Contains(letters[i]))
                {
                    charCount.Add(letters[i]);
                }

            }

            return charCount.Count == 26 ? "YES" : "NO";
        }


using System;

    class Program
    {
        static void Main(string[] args)
        {
            int num = Convert.ToInt32(Console.ReadLine());
            string str = Console.ReadLine();
            string res = "";
            str = str.ToLower();
            HashSet<string> hash = new HashSet<string>();
            for (int i = 0; i < num; i++)
            {
                hash.Add(Convert.ToString(str[i]));
            }

            string result = hash.Count == 26 ? "YES" : "NO";
            Console.WriteLine(result);
            Console.ReadKey();

        }

}


        char[] alphabet = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };

        int n = int.Parse(Console.ReadLine());
        if (n >= 26)
        {
            string input = Console.ReadLine();
            int count = 0;

            for (int i = 0; i < alphabet.Length; i++)
            {
                for (int j = 0; j < input.Length; j++)
                {
                    if (input[j].ToString().ToUpper().Contains(alphabet[i])) { count++; break; }
                }
            }
            if (count >= 26) { Console.WriteLine("YES"); }
        }
        else { Console.WriteLine("NO"); }


using System;

class Solution
{
    static void Main()
    {
        char[] alphabet = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
                'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };

        int n = int.Parse(Console.ReadLine());
        string input = Console.ReadLine();
        int count = 0;

        if (input.Length >= 26)
        {
            for (int i = 0; i < alphabet.Length; i++)
            {
                for (int j = 0; j < input.Length; j++)
                {
                    if (input[j].ToString().ToUpper().Contains(alphabet[i])) { count++; break; }
                }
            }
            if (count >= 26) { Console.WriteLine("YES"); }
        }
        else { Console.WriteLine("NO"); }

    }
}


using System;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            int[] k = new int[6];
            for (int i = 0; i < 6; i++)
            {
                k[i] = int.Parse(str[i]);
            }
            Array.Sort(k);
            if ((k[2] == k[3] & k[0] == k[1]) || (k[2] == k[3] & k[4] == k[5])||(k[1] == k[2] == k[3] == k[4]))
            {
                if (k[0] == k[1] & k[4] == k[5]) {
                    Console.WriteLine("Elephant");return;
                }
                else {
                Console.WriteLine("Bear"); return;
            }
            }else  Console.WriteLine("Alien");

       }
    }
}


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

namespace Codeforces296Task1
{
    static class Program
    {
        static TextReader _reader;
        static TextWriter _writer;
        static void Main(string[] args)
        {
#if DEBUG
            _reader = new StreamReader(@"input.txt");
            _writer = new StreamWriter(@"output.txt");
            //        Writer = new StreamWriter(@"C:\temp\output.txt");
#else
        Reader = new StreamReader(Console.OpenStandardInput());
        Writer = new StreamWriter(Console.OpenStandardOutput());
        //Reader = new StreamReader("cycle.in");
        //Writer = new StreamWriter("cycle.out");
#endif

            var n = ReadInt();

            var ar = ReadIntArray();

            var myVote = ar[0];

            var arr = ar.SubArray(1, ar.Length - 1);

            var res = 0;

            Array.Sort(arr);

            if (myVote <= arr[arr.Length - 1])
            for (int i = arr.Length - 1; i >= 0; i--)
            {
                if (myVote > arr[i])
                {
                    arr = arr.SubArray(i + 1, arr.Length - i - 1);

                    break;
                }
            }

            while (myVote <= arr[arr.Length - 1])
            {
                myVote++;
                arr[arr.Length - 1]--;
                res++;

                Array.Sort(arr);
            }

            _writer.WriteLine(res);

            _writer.Close();
            _reader.Close();
        }

        #region Pokachto neBolwaya Portyanka

        public static string EnumerableToString<T>(IEnumerable<T> enumerable)
        {
            var sb = new StringBuilder();

            int i = 1;

            foreach (var v in enumerable)
            {
                sb.Append(v.ToString());
                sb.Append(" ");
            }

            return sb.ToString();
        }

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

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

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

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

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

        static public Int64[] ReadInt64Array()
        {
            return _reader.ReadLine().Split(' ').Select(Int64.Parse).ToArray();
        }

        static T[] SubArray<T>(this T[] data, int index, int length)
        {
            T[] result = new T[length];
            Array.Copy(data, index, result, 0, length);
            return result;
        }
        #endregion
    }
}


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

namespace ConsoleApplication60
{
    class Program
    {

        static int max(int[]a)
        {
            int mx = 0;
            int id = 0;
            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] >= mx)
                {
                    mx = a[i];
                    id = i;
                }
            }
            return id;
        }

        static void main(string[] args)
        {
            //Console.WriteLine("Enter the num of candidates ");
            int n = int.Parse(Console.ReadLine());
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
            {
               arr[i]  = int.Parse(Console.ReadLine());
            }
            int c = 0;
            while (max(arr) != 0)
            {
                c++;
                arr[max(arr)]--;
                arr[0]++;
            }
            Console.WriteLine(c);
        }
    }
}


using System;
using System.Collections.Generic;

namespace AlgorithmsTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var count = Console.ReadLine();
            var inputString = Console.ReadLine().Split(' ').ToList();
            var input = new List<int>();

            foreach (var ch in inputString)
            {
                input.Add(Convert.ToInt32(ch));
            }

            int votes = 0;

            while (true)
            {
                int largestEnemy = input[0];
                int largestEnemyIndex = 0;
                for (int i = 1; i < input.Count; i++)
                {
                    if (input[i] >= largestEnemy)
                    {
                        largestEnemy = input[i];
                        largestEnemyIndex = i;
                    }
                }

                if (largestEnemyIndex == 0)
                    break;

                input[largestEnemyIndex]--;
                input[0]++;
                votes++;
            }

            Console.WriteLine(votes);
}
}
}


using System;
using System.Linq;

namespace App
{
    class Program
    {
        static void Main()
        {
            var res = string.Join('+', Console.ReadLine().Replace("+", "").OrderBy(x => x));
            Console.WriteLine(res);
        }
    }
}


using System;
using System.Linq;

namespace _339A.HelpfulMaths
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] numbers = Console.ReadLine().Split('+');
            Array.Sort(numbers);

            System.Console.WriteLine(string.Join('+',numbers));
        }
    }
}


using System;

class MainClass {
  public static void Main (string[] args) {
     string s = "1+1+3+1+3";
     string[] sArr  = s.Split("+");
     for(int i = 0; i < sArr.Length - 1; i++){
       for(int j = i+ 1; j < sArr.Length; j++){
         if(Int16.Parse(sArr[i]) > Int16.Parse(sArr[j])){
           string temp = sArr[i];
           sArr[i] = sArr[j];
           sArr[j] = temp;
         }
       }
     }

     s = String.Join("+" , sArr);

    Console.WriteLine(s);

  }
}


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

namespace YOLO
{
    class Program
    {
        static void Main(string[] args)
        {
            string x;
            x = Console.ReadLine();
            int[] data = new int[0];
            int index=0;
            string temp="";
            for(int i=0; i<x.Length; i++)
            {
                if(x[i]!='+'){
                    temp+=x[i];
                }
                else{
                    Array.Resize(ref data, data.Length+1);
                    data[index] = Convert.ToInt32(temp);
                    index++;
                    temp = "";
                }
            }
            data.Sort();

            for(int i=0; i<data.Length; i++){
                Console.Write(data[i]);
                if(i!=data.Length-1){
                    Console.Write("+");
                }
            }
        }
    }
}


using System;
using System.Text;
namespace CP
{
    class Program
    {
        static void Main(string[] args)
        {
            int [] arr = Array.ConvertAll(Console.ReadLine().Split('+') , temp => Convert.ToInt32(temp));
            Array.Sort(arr);
            string s1 = String.Join('+' , arr);
            Console.WriteLine(s1);

        }

    }
}


using System;

class hmath {
	public static void Main() {
	string[] arr=Console.ReadLine().Split('+');
	Array.Sort(arr);
	Console.WriteLine(string.Join('+',arr));
	}
}


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

int main()
{
    char inp[100];
    gets(inp);
    int i, length = strlen(inp), j;
    char temp = ' ';
    for(i = 0; i < length; i++ )
    {
        for(j = 0; j < length - 2; j++)
        {
            if(inp[j] > inp[j+2])
            {
                temp = inp[j];
                inp[j] = inp[j + 2];
                inp[j + 2] = temp;
            }
        }
    }
    for(i = 0; i < length; i++)
    {
        printf("%c", inp[i]);
    }

    return 0;
}


using System;
using System.Linq;

class Program
{
    static void Main()
    {
        try
        {
            int[] numbers = Console.ReadLine().Split('+', StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

            string outLine = SortArithmeticSentece(numbers);
            Console.WriteLine(outLine);
        }
        catch(Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
        Console.ReadLine();
    }

    private static string SortArithmeticSentece(int[] numbers)
    {
        Array.Sort(numbers);
        string outStr = "";
        for(int i = 0; i < numbers.Length; i++)
        {
            if(i == numbers.Length - 1)
            {
                outStr += numbers[i];
                break;
            }
            else
            {
                outStr += numbers[i] + "+";
            }
        }
        return outStr;
    }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
			string textBox1 = Console.ReadLine();
           /* char[] arr;
            arr = num.ToCharArray(0, num.Length);
           */
 		    string textBox2;//= Console.ReadLine();
           /* char[] arr2;
            arr2 = num.ToCharArray(0, num.Length);
*/
            int len = textBox1.Length;
            char[] first = new char[len];
            char[] second = new char[len];
            int i = 0;
            char buf;
            int j = 0;
            while (i < len)
            {
                if (textBox1[i] != '+')
                {
                    first[j] = textBox1[i];
                    j++;
                }
                i++;
            }
            i = 1;
            while (i < j)
            {
                if (first[i] < first[i - 1])
                {
                    buf = first[i - 1];
                    first[i - 1] = first[i];
                    first[i] = buf;
                    if (i > 1) i--;
                }
                else i++;
            }
            j = 0;
            i = 0;
            while (i < len)
            {
                if (i % 2 == 0)
                {
                    textBox2 += first[j].ToString();
                    j++;
                }
                else textBox2 += '+';
                i++;
            }

			Console.WriteLine(textBox2);

         }
    }
}


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

namespace CSharp_Contests
{
    public class Program
    {
System.Threading.Thread.Sleep(500);
        public static void Main() {
            int[] n = new int[3] { int.Parse(Console.ReadLine()), int.Parse(Console.ReadLine()), int.Parse(Console.ReadLine()) };
            int[] arth = new int[4] { n[0] + n[1] + n[2], n[0] * ( n[1] + n[2] ), n[0] * n[1] * n[2], ( n[0] + n[1] ) * n[2] };
            Console.WriteLine(arth.Max());

#if DEBUG
            Console.ReadLine();
#endif
        }
    }
}System.Threading.Thread.Sleep(500);


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Problema A EXPRESSÃO", "Problema A EXPRESSÃO\Problema A EXPRESSÃO.csproj", "{4C4E4E0B-8312-4B72-84D4-72B9621E8FB2}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{4C4E4E0B-8312-4B72-84D4-72B9621E8FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{4C4E4E0B-8312-4B72-84D4-72B9621E8FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{4C4E4E0B-8312-4B72-84D4-72B9621E8FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{4C4E4E0B-8312-4B72-84D4-72B9621E8FB2}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


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

namespace ConsoleApp
{
    class Program
    {
        static void Main()
        {
            int x = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int y = Convert.ToInt32(Console.ReadLine());
            int r, r1, r2, r3;
            List<int> list = new List<int>();

            r = (x + n) * y;
            r1 = x * n * y;
            r2 = x * (n + y);
            r3 = x + n * y;

            list.Add(r);
            list.Add(r1);
            list.Add(r2);
            list.Add(r3);

            int maxValue = list.Max();

            if (x == 1 & n == 1 & y == 1)
            {
                Console.WriteLine(3);
            }
            else
            {
                if (x == 1 & y == 1)
                {
                    Console.WriteLine(maxValue + 1);
                }
                    else
                    {
                        Console.WriteLine(maxValue);
                    }
                }
            }

        }
    }
}


using System;
using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography.X509Certificates;

namespace Expression
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = Convert.ToInt32(Console.ReadLine());
            int b = Convert.ToInt32(Console.ReadLine());
            int c = Convert.ToInt32(Console.ReadLine());

            int option1 = Math.Max((a + b) * c, a * (b + c));
            int option2 = Math.Max(a * b * c, a + b + c);

            Console.WriteLine(Math.Max(option1, option2));

            Console.ReadLine();
        }
    }
}


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

class Startup
{
    static void Main()
    {
        int[] intInput = ReadLineAndParseToArray();
        int n = intInput[0];
        int nTemp = n;
        int m = intInput[1];

        if(n == m) Console.WriteLine($"{n}");
        if((m % 2*n != 0 ) && ( m % 3*n != 0) && ( m % 6*n != 0)) Console.WriteLine("-1");

        int 2counter = 0;
        int 3counter = 0;
        while(nTemp % 2 == 0) { nTemp /= 2; 2counter++; }
        while(nTemp % 3 == 0) { nTemp /= 3; 3counter++; }

        int counter = 0;
        while(m % 2 == 0 ) { m /= 2; counter++; }
        while(m % 3 == 0) { m /= 3; counter++; }
        counter -= 2counter;
        counter -= 3counter;
        Console.WriteLine($"{counter}");

    }

    static int[] ReadLineAndParseToArray()
    {
        return Console.ReadLine().Split().Select(int.Parse).ToArray();
    }

}


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

namespace A
{
    class Program
    {
        static List<long> ReadListOfInts()
        {
            var input = Console.ReadLine()
                .Split(" ")
                .Where(str => !string.IsNullOrEmpty(str))
                .Select(str => Convert.ToInt64(str))
                .ToList();
            return input;
        }
        static void Main(string[] args)
        {
            var inp = ReadListOfInts();
            long n = inp[0];
            long m = inp[1];
            if (m < n)
            {
                Console.WriteLine("-1");
            }
            else if (m == n)
            {
                Console.WriteLine("0");
            }
            else
            {
                int twos = 0;
                int threes = 0;

                while (n % 2 == 0)
                {
                    n /= 2;
                    twos--;
                }
                while (n % 3 == 0)
                {
                    n /= 3;
                    threes--;
                }
                while (m % 2 == 0)
                {
                    m /= 2;
                    twos++;
                }
                while (m % 3 == 0)
                {
                    m /= 3;
                    threes++;
                }
                if (twos < 0 || threes < 0)
                {
                    Console.WriteLine("-1");
                }
                else if (n != m)
                {
                    Console.WriteLine("-1");
                }
                else
                {
                    int answer = twos + threes;
                    Console.WriteLine(answer);
                }
            }
        }
    }
}


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

namespace CodeForces
{
    public static class Class1
    {

        public static int Method1(int number, int result)
        {
            int res = 1;
            if (result / number % 1 == 0)
                result /= number;
            else if (result == number)
                return 0;
            else return -1;
            while (result>2)
            {
                res++;
                result = result % 3 == 0 ? result / 3 : result / 2;
            }
            return res;
        }

    }
}


            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();

            int start = 0;
            int last = 0;
            string lastStr = s.Substring(start, 2);

            while (start != n - 1)
            {
                string d = s.Substring(start, 2);

                int current = 0;
                for (int i = start+1; i < n - 1; i++)
                {
                    if ((s[i].ToString() + s[i + 1].ToString()) == d)
                    {
                        current++;
                    }
                }

                if (current > last)
                {
                    last = current;
                    lastStr = d;
                }
                start++;
            }

            Console.WriteLine(lastStr);


            var n = Convert.ToInt32(Console.ReadLine());
            var s = Console.ReadLine();

            var start = 0;
            int last = 0;
            var lastStr = s.Substring(start, 2);

            while (start != n - 1)
            {
                var d = s.Substring(start, 2);

                int current = 0;
                for (int i = start+1; i < n - 1; i++)
                {
                    if ((s[i].ToString() + s[i + 1].ToString()) == d)
                    {
                        current++;
                    }
                }

                if (current > last)
                {
                    last = current;
                    lastStr = d;
                }
                start++;
            }

            Console.WriteLine(lastStr);


using System;
    class Program
    {
        static void Main(string[] args)
        {
int c;
Console.WriteLine((c = Console.ReadLine().Count(d => d == '4' || d == '7')) == 4 || c == 7 ? "YES" : "NO");
        }
    }


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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            Int64 n = int.Parse(Console.ReadLine());
            bool res = true;
            int s = n;
            int temp = 0;
            while (s != 0)
            {
                temp = s % 10;
                if (temp != 7 && temp != 4)
                {
                    res = false;
                    break;
                }
                s /= 10;
            }
            if (res)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
         //   Console.ReadKey();
            //  Console.WriteLine(string.Join(", ", primeNumbers));
            // Console.ReadLine();
            //   var line = Console.ReadLine().Split(new[] { ' ' });

        }
    }
}


using System;
using System.IO;
namespace C_
{
    class Program
    {
        static void Main(string[] args)
        {

            int count = 0;
            int x =Convert.ToInt32(Console.ReadLine());
            int [] home = new int[x];
            int [] gest = new int [x];
            for (int i = 0; i < x; i++)
            {
                Console.Write(home[i]);
                Console.Write(gest[i]);
            }
            for (int i = 0; i < x; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (home[i] == gest[j])
                    {
                        count++;
                    }
                }
            }
        }
    }
}


using System;

namespace ps
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] teams = new string[n];
            int count = 0;

            for (int i = 0; i < n; i++) {
                teams[i] = Console.ReadLine();
            }
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++)
                {
                    if (j != i)
                    {
                        if (teams[i].Split(" ")[0] == teams[j].Split(" ")[1])
                        {
                            count++;
                        }
                    }
                }
            }

            Console.WriteLine(count);
        }
    }
}


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

class P {
  static int result = 1;
  static void Main() {
    var x = int.Parse(Console.ReadLine());
    var digits = 0;
    { var temp = x;
    while (temp > 0) { x = x | (1 << (temp%10)); temp /= 10; } }
    var divs = new List<int>();
    for (var d = 2; d <= x ; d++) {
      if (x % d == 0) { divs.Add(d); x /= d; d--; }
    Recurse(divs, 0, 1, digits);
    Console.Write(result);
  }

  static void Recurse(List<int> divs, int i, int n, int digits) {
    if (i >= divs.Count) {
      while (n > 0) {
        if ((digits & (1 << (n%10)))!=0) { result++; return; }
        n /= 10;
      }
    Recurse(divs, i + 1, n * divs[i], digits);
    do { i++; }
    while (i < divs.Count && divs[i] == divs[i-1]);
    Recurse(divs, i, n, digits);
  }
}


using System;
using System.Collections.Generic;
using System.Linq;
namespace rapidPrograming
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Console.ReadLine();
            var nums = Console.ReadLine().Split().Select((s) => Convert.ToInt32(s)).ToList();
            var max = 0;
            for(int i = nums.Count; i > 0; i--)
            {
                for(int j = 0; j <= nums.Count-i; j++)
                {
                   // Console.WriteLine($"{j},{i}");
                    var nums2 = nums.GetRange(j, i).Select(n => n == 0 ? 1:0).ToList() ;
                    var before = nums.GetRange(0, j);
                    var after = nums.GetRange(j + i, nums.Count - nums2.Count-before.Count);
                    var count= nums2.Count(n => n == 1)+ before.Count(n => n == 1)+ after.Count(n => n == 1);
                    if (count > max)
                    {
                        max = count;
                    }
                }

            }
            Console.WriteLine(max);
        }
    }
}


using System;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Console.ReadLine(); //Convert.ToInt32(Console.ReadLine());
            int[] a = new int[n];
            int s,er;
            int t = 0;
            int jami = 0;
            for (int i = 0; i < n; i++)
            {
				Console.ReadLine();
                //a[i] = Convert.ToInt32(Console.ReadLine());
                jami += a[i];

            };
			a[0]=1;
			a[1]=0;
			a[2]=0;
			a[3]=1;
			a[4]=0;

            s = jami;
            for (int i = 0; i < n; i++)
            {
                jami = s;
                if (a[i] == 0)
                {
                    jami += 1;
                }
                if (a[i] == 1)
                {
                    jami -= 1;
                }
                for (int j = i + 1; j < n; j++)
                {
                    if (a[j] == 0)
                    {
                        jami += 1;
                    }
                    if (a[j] == 1)
                    {
                        jami -= 1;
                    }
                    if (jami > t)
                    {
                        t = jami;
                    }

                }
            }

            Console.WriteLine(t);

        }
    }
}


using System;

class MyBuild
{
    static void Main()
    {
        string input = Console.ReadLine();
        string[] dim = input.Split(


using System;

namespace program{
    class program{
        static void main{
            int[] NxM = int.Parse(Console.Readline().split(' '));

            Console.Writeline("{0}", (NxM[0] * NxM[1]) / 2);
        }
    }
}


using System;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {

            string a = Console.ReadLine();

            int n = Int32.Parse(0,a.IndexOf(" "));
            int m = Int32.Parse(a.IndexOf(" ")+1);

            Console.WriteLine(n*m/2);
        }
    }
}


using System;

namespace program{
    class program{
        static void Main(string[] args){
            int[] NxM = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

            Console.WriteLine("{0}", (NxM[0] * NxM[1]) / 2);
        }
    }
}


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{815E1B5E-ACD8-4D14-B9A5-0958A360213A}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>Codeforces_Beta_Round_47_A__Domino_piling_</RootNamespace>
    <AssemblyName>Codeforces Beta Round 47 A %28Domino piling%29</AssemblyName>
    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <Deterministic>true</Deterministic>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


using System;

namespace program{
    class program{
        static void main{
            int[] NxM = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

            Console.WriteLine("{0}", (NxM[0] * NxM[1]) / 2);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Collections.Immutable;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {

            var a = Console.ReadLine();
            string[] b = a.Split(' ');
            int x,y ;
            int.TryParse(b[0] , out x) ;
            int.TryParse(b[1] , out y) ;
            int c = x * y / 2;
            Console.WriteLine(c);
        }
    }
}


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

namespace CodeForces
{
    class Class50A
    {
        static void Main(string[] args)
        {
            string[] d = Console.ReadLine().Split(' ');
            int m = int.Parse(d[0]);
            int n = int.Parse(d[1]);
            Console.WriteLine(m*n/2);
            Console.ReadLine();
        }
    }


using System;
class Program

{

static void Main(string[] args)

{

int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);

int M = input[0];

int N = input[1];

int result = (M / 2) * N + (M%2==0)?0 :  (N / 2);

Console.WriteLine(result);

}

}


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

namespace year
{
    class Program
    {
        static void Main(string[] args)
        {

int  c_year;
string n_year;
            m = int.parse(Console.ReadLine());

            c_year++;
            while (true)
            {
              n_year =Convert.ToString(c_year);
                if  (n_year[1] !=  n_year[0] &&  n_year[0] !=  n_year[2] &&  n_year[3] !=  n_year[0] && n_year[1] !=  n_year[2] &&  n_year[1] !=  n_year[3] &&  n_year[2] !=  n_year[3])
                {
                   Console.WriteLine( n_year);
                }
	else	{
               		     c_year++;
          		  }
	}

	}
	}
	}


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

namespace ConsoleApp1
{
    class Program
    {
        static void Main()
        {
            int y = Convert.ToInt32(Console.ReadLine());
            int a, b, c, d;
            while (true)
            {
                y = y + 1;
                a = y / 1000;
                b = y / 100 % 10;
                c = y / 10 % 10;
                d = y % 10;
                if (a != b && a != c && a != d && b != c && b != d && c != d)
                {
                    break;
                }
            }
            Console.WriteLine(y);
        }
    }


using System;
using System.Diagnostics.Tracing;
namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            int c = Convert.ToInt32(Console.ReadLine());
            for (int i = ++c; i < 9001; i++)
            {
                string b = i.ToString();
                if (ass(b))
                {
                    Console.WriteLine(i);
                    break;
                }
            }

        }
        public static bool ass(string aa)
        {
           int counter = 0;
            for (int i = 0; i <=9; i++)
            {
                if (aa.Contains((char) (i+48))) counter++;
            }
            if (counter == 4) return true;
            return false;
        }
    }
}


using System;
using System.Collections;
using System.Collections.Generics;
using System.Linq;

namespace Problem{

    public class Solution{

        public void Main(){

            int n = int.Parse(Console.ReadLine());
             if(n == 1){
                 Console.WriteLine(n);
             }else{
                 Console.WriteLine((n*2 - 3)*(n*2 - 3) + 4);
             }
        }
    }
}


using System;

namespace ConsoleApp12
{
    class Program
    {

        static int Compute(int n)
        {
            int last = n * 2 - 1;
            return (1 + last) * n - last;
        }
    }
}


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

namespace ContestRuns
{
    using System.ComponentModel;
    using System.Linq;
    using System.ServiceProcess;

    class Program
    {
        class Edge
        {
            public int a, b, cap, flow;
        };

        private static int n, source, target;
        private static int[] d, ptr, q;
        private static List<Edge> e = new List<Edge>();
        private static List<List<int>> g;

        static void add_edge(int a, int b, int cap)
        {
            Edge e1 = new Edge {a = a, b = b, cap = cap, flow = 0};
            Edge e2 = new Edge {a = b, b = a, cap = 0, flow = 0};
            g[a].Add(e.Count);
            e.Add(e1);
            g[b].Add(e.Count);
            e.Add(e2);
        }

        static bool bfs()
        {
            int qh = 0, qt = 0;
            q[qt++] = source;

            d = Enumerable.Repeat(-1, n).ToArray();
            d[source] = 0;
            while (qh < qt && d[target] == -1)
            {
                int v = q[qh++];
                for (int i = 0; i < g[v].Count; ++i)
                {
                    int id = g[v][i],
                        to = e[id].b;
                    if (d[to] == -1 && e[id].flow < e[id].cap)
                    {
                        q[qt++] = to;
                        d[to] = d[v] + 1;
                    }
                }
            }
            return d[target] != -1;
        }

        static int dfs(int v, int flow)
        {
            if (flow <= 0) return 0;
            if (v == target) return flow;
            for (; ptr[v] < g[v].Count; ++ptr[v])
            {
                int id = g[v][ptr[v]],
                    to = e[id].b;
                if (d[to] != d[v] + 1) continue;
                int pushed = dfs(to, Math.Min(flow, e[id].cap - e[id].flow));
                if (pushed != 0)
                {
                    e[id].flow += pushed;
                    e[id ^ 1].flow -= pushed;
                    return pushed;
                }
            }
            return 0;
        }

        static int dinic()
        {
            int flow = 0;
            for (;;)
            {
                if (!bfs()) break;
                ptr = new int[n];
                for (;;)
                {
                    int pushed = dfs(source, int.MaxValue);
                    if (pushed == 0) break;
                    flow += pushed;
                }
            }
            return flow;
        }

#if DEBUG
        static readonly TextReader input = File.OpenText(@"../../A/A.in");
        static readonly TextWriter output = File.CreateText(@"../../A/A.out");
#endif
        //static readonly TextReader input = Console.In;
        //static readonly TextWriter output = Console.Out;

        class Horse
        {
            public decimal distForHorse;
            public decimal timeAlready;
        };
        class Edge1
        {
            public int from, to;
            public decimal dist;
        };
        private static void SolveA()
        {
            int T = int.Parse(input.ReadLine());

            output.WriteLine((T/2 + T%2)-1);
            //int[] inp = input.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }

        static void Main(string[] args)
        {
            SolveA();
            output.Flush();
        }
    }

}


using System;

class A651 {
    public static void Main() {
        var line = Console.ReadLine().Split();
        var a1 = int.Parse(line[0]);
        var a2 = int.Parse(line[1]);
        var ans = (a1 - a2) % 3 == 0 ? a1 + a2 - 3 : a1 + a2 - 2
        Console.WriteLine(Math.Max(0, ans));
    }
}


static void Main(string[] args)
        {
            int[] a = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
            //Console.WriteLine(a[0]+" "+a[1]);

            int count = 0;
            while(a[0]>0 && a[1] > 0)
            {
                count++;
                if(a[0]>a[1])
                {
                    a[0] -= 2;
                    a[1] += 1;
                }
                else
                {
                    a[0] += 1;
                    a[1] -= 2;
                }
                //Console.WriteLine(a[0]+" "+a[1]);
            }
            Console.WriteLine(count);
            //Console.ReadKey();
        }


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

namespace problem651A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            int joy1 = Convert.ToInt32(str[0]);
            int joy2 = Convert.ToInt32(str[1]);
            int min = 0;
            bool flag = true;

            if(joy1 < joy2)
            {
                int temp = joy1;
                joy1 = joy2;
                joy2 = temp;
            }

            while(joy1 > 0 && joy2 > 0)
            {
                if(joy 1 == 1 && joy2 == 1)
                        break;
                if (flag)
                {
                    joy1 -= 2;
                    joy2 += 1;
                    min++;
                    if (joy1 == 1 || joy1 == 2)
                        flag = false;
                }
                else
                {
                    joy1 += 1;
                    joy2 -= 2;
                    min++;
                    if (joy2 == 1 || joy2 == 2)
                        flag = true;
                }

            }
            Console.WriteLine(min);
        }
    }
}


/*
 * TemplateCS
 * Copyright (C) 2014-2016 Markus Himmel
 * This file is distributed under the terms of the MIT license
 */

//#define CodeJam
#define CodeForces

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

namespace ProgrammingCompetitions
{
	class Program
	{

		#region GCJ
#if CodeJam
		private static bool DEBUG = false;

		static void debug()
		{
		}

		static string solveCase(int num)
		{
			checked
			{
				return null;
			}
		}
#endif
		#endregion

		#region CodeForces
#if CodeForces
#if DEBUG
		static Queue<string> testInput = new Queue<string>(string.Format(@"

4 4

").Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries));
#endif

		static object Solve()
		{
			checked
			{
				int a, b;
				read(out a, out b);
				int mins = 0;
				while (a > 0 && b > 0)
				{
					mins++;
					if (a > b)
					{
						b++;
						a -= 2;
					}
					else
					{
						a++;
						b -= 2;
					}
				}

				return mins;
			}
		}
#endif
		#endregion

		// Everything after this comment is template code

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

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

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

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

		private static T[][] readMany<T>(int n)
		{
			T[][] res = new T[n][];
			for (int i = 0; i < n; i++)
			{
				res[i] = readMany<T>();
			}
			return res;
		}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		static T id<T>(T a)
		{
			return a;
		}

		public static T[][] mkarr<T>(int x, int y)
		{
			T[][] res = new T[x][];
			for (int i = 0; i < x; i++)
			{
				res[i] = new T[y];
			}
			return res;
		}

		public static T[][][] mkarr<T>(int x, int y, int z)
		{
			T[][][] res = new T[x][][];
			for (int i = 0; i < x; i++)
			{
				res[i] = new T[y][];
				for (int j = 0; j < y; j++)
				{
					res[i][j] = new T[z];
				}
			}
			return res;
		}

		static bool[] tf = new[] { true, false };

#if CodeJam

		static void Main(string[] args)
		{
			if (DEBUG)
			{
				debug();
			}
			else
			{
				Initialize();
				SolveAll(solveCase);
			}
			Console.ReadKey();
		}

		private static StreamReader inf;
		private static StreamWriter outf;

		private delegate void o(string format, params object[] args);
		private static o Output;

		public static void Initialize()
		{
			Console.ForegroundColor = ConsoleColor.Yellow;
			Console.Write("File name: ");
			string name = Console.ReadLine();
			inf = new StreamReader($"D:\\Users\\marku\\Downloads\\{name}.in");
			outf = new StreamWriter($"D:\\Users\\marku\\Downloads\\{name}.out");
			Console.ForegroundColor = ConsoleColor.White;
			Output = highlightedPrint;
			Output += outf.WriteLine;
		}

		private static void highlightedPrint(string format, params object[] args)
		{
			ConsoleColor prev = Console.ForegroundColor;
			Console.ForegroundColor = ConsoleColor.Green;
			Console.WriteLine(format, args);
			Console.ForegroundColor = prev;
		}

		public static void SolveAll(Func<int, string> calc)
		{
			int cases = int.Parse(inf.ReadLine());
			for (int _ = 1; _ <= cases; _++)
			{
				Output($"Case #{_}: {calc(_)}");
			}
			inf.Close();
			outf.Close();
			Console.ForegroundColor = ConsoleColor.Cyan;
			Console.WriteLine("Eureka!");
		}

		private static string read()
		{
			return inf.ReadLine();
		}
#endif

#if CodeForces
		static string asString(object s)
		{
			return (s as double?)?.ToString("0.000000000", System.Globalization.CultureInfo.InvariantCulture) ?? s.ToString();
		}

		static void Main(string[] args)
		{
#if DEBUG
			var sw = new System.Diagnostics.Stopwatch();
			sw.Start();
#endif
			object o = Solve();
			if (o != null)
			{
				string s = null;
				if (o is System.Collections.IEnumerable)
				{
					s = string.Join(" ", ((System.Collections.IEnumerable)o).OfType<object>().Select(x => asString(x)));
				}
				else
				{
					s = asString(o);
				}
				if (!string.IsNullOrEmpty(s))
				{
					Console.WriteLine(s);
				}
			}
#if DEBUG
			sw.Stop();
			Console.WriteLine(sw.Elapsed);
			Console.ReadKey();
#endif
		}

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

	public static class ExtensionMethods
	{
		public static IEnumerable<T> Of<T>(this int n, Func<T> gen)
		{
			for (int i = 0; i < n; i++)
			{
				yield return gen();
			}
		}

		public static IEnumerable<T> Of<T>(this int n, Func<long, T> gen)
		{
			for (int i = 0; i < n; i++)
			{
				yield return gen(i);
			}
		}

		public static IEnumerable<T> Of<T>(this int n, T gen)
		{
			for (int i = 0; i < n; i++)
			{
				yield return gen;
			}
		}

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

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

		public static IEnumerable<Tuple<T1, T2>> CartesianE<T1, T2>(this IEnumerable<T1> first, IEnumerable<T2> second)
		{
			// Calling CartesianE prevents selection of the wrong overload of Cartesian when you want a tuple of tuples to be returned
			return first.Cartesian(second);
		}

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

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

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

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

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

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

		public static IEnumerable<IEnumerable<IEnumerable<T>>> Partition<T>(this IEnumerable<T> source, int groups)
		{
			foreach (var part in Enumerable.Range(0, groups).Pow(source.Count()).Select(x => x.ToArray()))
			{
				yield return Enumerable.Range(0, groups).Select(x => source.Where((item, idx) => part[idx] == x));
			}
		}

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

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

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

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

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

		public static T[][] Rho<T>(this IEnumerable<T> source, int x, int y)
		{
			T[][] res = Program.mkarr<T>(x, y);

			int i = 0, j = 0;

			while (true)
			{
				foreach (T item in source)
				{
					res[i][j] = item;
					j++;
					if (j == y)
					{
						j = 0;
						i++;
						if (i == x)
							break;
					}
				}
				if (i == x)
					break;
			}

			return res;
		}

		public static T[][][] Rho<T>(this IEnumerable<T> source, int x, int y, int z)
		{
			T[][][] res = Program.mkarr<T>(x, y, z);

			int i = 0, j = 0, k = 0;
			while (true)
			{
				foreach (T item in source)
				{
					res[i][j][k] = item;
					k++;
					if (k == z)
					{
						k = 0;
						j++;
						if (j == y)
						{
							j = 0;
							i++;
							if (i == x)
							{
								break;
							}
						}
					}
				}
				if (i == x)
					break;
			}

			return res;
		}
	}
}


using System;
using System.Globalization;

namespace Codeforces
{
    internal static class Program
    {
        private static void Main()
        {
            var xs = Console.ReadLine().Split().Select(long.Parse).ToList();
            var a1 = xs[0];
            var a2 = xs[1];

            for (long i = 0; i < long.MaxValue; i++)
            {
                if (a1 <= 1 || a2 <= 1)
                {
                    Print(i);
                    return;
                }

                if (a1 < a2)
                {
                    a1 += 1;
                    a2 -= 2;
                }
                else
                {
                    a1 -= 2;
                    a2 += 1;
                }
            }
        }

        private static void Print(string s) { Console.WriteLine(s); }
        private static void Print(long x) { Console.WriteLine(x.ToString(CultureInfo.InvariantCulture)); }
        private static void Print(double x) { Console.WriteLine(x.ToString(CultureInfo.InvariantCulture)); }

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


using System;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

public class Hello{
    public static void Main(){
        string[] input = ReadLine().Split(' ');
        int tyouten = int.Parse(input[0]);
        long hen = long.Parse(input[1]);

        if(tyouten == 1){
            WriteLine("1 1");
        }else if(hen == 0){
            WriteLine("{0} {1}",tyouten,tyouten);
        }else{

        //min
        int tyoutemp = (tyouten+1)/2;
        int oe = tyouten%2;
        int tempmin = (tyoutemp - hen)*2-oe;
        int min = Max(tempmin,0);
        Write("{0} ",min);

        //Max
        int check = 0;
        for(int i=2;i<=tyouten;i++){
            long saidai = (i*(i-1))/2; //頂点i個に対して使える辺の最大値
            if(saidai >= hen){
                check = i;
                break;
            }
        }
        int max = tyouten - check;
        WriteLine(max);

        }
    }
}


using System;
using static System.Console;
using static System.Convert;

class program
{
     public static void Main()
     {

    class program_10
    {
        public static void Main()
        {
            string x = ReadLine();
            char f = (x[0] > 'a' && x[0] < 'z') ? (char)(x[0] - 32) : x[0];
            Console.Write(f);
            for (int i = 1; i < x.Length; i++)
            {
                Console.Write(x[i]);
            }
            Console.WriteLine();
        }
    }

     }
}


using System;
using static System.Console;
using static System.Convert;

    class program_10
    {
        public static void Main()
        {
            string x = ReadLine();
            char f = (x[0] >= 'a' && x[0] =< 'z') ? (char)(x[0] - 32) : x[0];
            Console.Write(f);
            for (int i = 1; i < x.Length; i++)
            {
                Console.Write(x[i]);
            }
            Console.WriteLine();
        }
    }


using System;
class program{
    static void Main(){
        var str = Console.ReadLine();
       Console.WriteLine(str[0].ToUpper() + str.Substring(1,str.Length()-1));    }
}


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

namespace Olymp_dop
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            Console.Write(s[0].ToString().ToUpper() + s.Substring(1, s.Length - 1););
        }
    }
}


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

namespace Три_гирлянды
{
    class Program
    {
        static void Main(string[] args)
        {
            int T = 0;
            var S = Console.ReadLine().Split();
            long[] A = new long[3];
            for (int i = 0; i < 3; i++) A[i] = Convert.ToInt64(S[i]);
            Array.Sort(A);
            if (A[0] == 1) T = 1;
            if (A[0] == 2 && A[1] == 2) T = 1;
            if (A[0] == 2 && A[1] == 4 && A[2] == 4) T = 1;
            if (A[0] == 3 && A[1] == 3 && A[2] == 3) T = 1;

            if (T == 1) Console.Write("YES");
            else Console.Write("NO");

        }
    }


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TasksCodeForce._700;
using TasksCodeForce._800;

namespace TasksCodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            _978B_FileName.Method();
        }
    }
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
        int a[100], n;
        cin >> n;
        for(int i = 0; i < n; i++)
                cin >> a[i];
        sort(a, a+n);
        for(int i = 0; i < n; i++)
                cout << a[i] << ' ';
        cout << endl;
}


using System;

namespace repos
{
    class Program
    {
        static void Main(string[] args)
        {
            int colNum=int.Parse(Console.ReadLine());
            string[] CubsPerCol=Console.ReadLine().Split(' ');
            Console.WriteLine(colNum.Sort());
        }
    }
}


using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
using System.Threading.Tasks.Dataflow;
using static System.Console;

namespace task
{
    class Program
    {
        static void Main(string[] args)
        {
            var k = int.Parse(ReadLine());
            var startData = ReadLine().Split(' ').Select(int.Parse);
            var data = startData.OrderByDescending(p=>p);
            var length = data.Count() -1;
            var str = string.Empty;
            for (var i = 0; i <= length; i++)
            {
                var dif = data.ElementAt(length - i) - startData.ElementAt(length - i);
                var res = dif + startData.ElementAt(length - i);
                str += (res) + " ";
            }
            WriteLine(str);
        }
    }
}


using System;

public class WrongSubtraction{
    static void Main(string[] args){
        int n, k;
        n = int.Parse(Console.ReadLine());
        k = int.Parse(Console.ReadLine());
        for(int i = 0; i < k; i ++){
            n = (n % 10 == 0? n / 10 : n - 1);
        }
        return n;
    }
}


using System;

public class Test
{
	public static void Main()
	{
		/int[] dizi = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
			int sonuc = dizi[0];
			for (int i = 0; i < dizi[1]; i++)
			{
				if ( sonuc % 10 == 0)
				{
					sonuc = sonuc / 10;
				}
				else
				{
					sonuc--;
				}
			}Console.WriteLine(sonuc);
	}
}


  static void wrongSubtract(int n, int k)
        {
            for(int i = 0;i < k; i++)
            {
                if (n.ToString()[n.ToString().Length - 1] != '0')
                    n--;
                else
                    n /= 10;
            }
            Console.WriteLine(n);
        }


class TestClass
{
    static void Main(string[] args)
    {
       String s = Console.ReadLine();

       String[] values = s.split(" ").toArray();

       String value1 = values[0];
       String value2 = values[1];

       int valueInt = Convert.toInt32(value1);
       for( int i = 0 ; i < value2 ; i++){

           if (valueInt % 10 != 0)
           {
               valueInt = valueInt - 1;
           } else {
               valueInt = valueInt/10;
           }

       }
       System.Console.WriteLine(valueInt);

    }
}


using System;

namespace CSharp
{
    class Program
    {
        private static void WrongSubtraction(int n, int k)
        {
            for (int i = 0; i < k; i++)
            {
                if (n % 10 == 0)
                {
                    n /= 10;
                }
                else
                    n--;
            }
            Console.WriteLine(n);
        }
    }
}


using System;
namespace test
{
    class Program
    {
        static void Main(String[] args)
        {
            string[] sa = Console.ReadLine().split(' ');
            int a = Convert.ToInt32(sa[0]);
            int b = Convert.ToInt32(sa[1]);
            for(int i=0;i<b;i++)
            {
                if(a%10==0) a/=10;
                else a-=1;
            }
            Console.WriteLine(a);
        }
    }
}


using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var inp = (Console.ReadLine()).Split(" ");
            var inp_1 = Int32.Parse(inp[0]);
            var inp_2 = Int32.Parse(inp[1]);

            while (inp_2 > 0)
            {
                inp_1 = (inp_1 % 10 == 0) ? inp_1 / 10 :
                 inp_1 - 1;
                inp_2--;
            }

            Console.WriteLine(inp_1);
            Console.ReadKey();
        }
    }
}


using System;
using System.Linq;
namespace HWCODEFORCE
{
    class Program
    {
        static void Task110A()
        {
            var numbers = Console.ReadLine().Split(" ");
            int size = Convert.ToInt32(numbers[1]);
            int num = Convert.ToInt32(numbers[0]);
            for (int i = 0; i < size; ++i)
            {
                if (num % 10 == 0)
                {
                    num /= 10;
                }
                else
                {
                    num -= 1;
                }
            }
            Console.WriteLine(num);
        }
        static void Main(string[] args)
        {
            Task110A();

        }
    }
}


static int w_Sub(int n,int k)
        {
            int result=n;

            for (int i = 0; i < k; i++)
            {
                if (result.ToString()[result.ToString().Length - 1] == '0')
                {
                    result /= 10;
                    Console.WriteLine(result);
                }
                else
                {
                    result--;
                    Console.WriteLine(result);
                }
            }

            return result;
        }