This winter is so cold in Nvodsk! A group of n friends decided to buy k bottles of a soft drink called "Take-It-Light" to warm up a bit. Each bottle has l milliliters of the drink. Also they bought c limes and cut each of them into d slices. After that they found p grams of salt.To make a toast, each friend needs nl milliliters of the drink, a slice of lime and np grams of salt. The friends want to make as many toasts as they can, provided they all drink the same amount. How many toasts can each friend make?

The first and only line contains positive integers n, k, l, c, d, p, nl, np, not exceeding 1000 and no less than 1. The numbers are separated by exactly one space.

Print a single integer — the number of toasts each friend can make.

NoteA comment to the first sample: Overall the friends have 4 * 5 = 20 milliliters of the drink, it is enough to make 20 / 3 = 6 toasts. The limes are enough for 10 * 8 = 80 toasts and the salt is enough for 100 / 1 = 100 toasts. However, there are 3 friends in the group, so the answer is min(6, 80, 100) / 3 = 2.

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

namespace ConsoleApp2
{
	class Program
	{
		static void Main(string[] args)
		{
			var number = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
			var friends = number[0];
			var bottles = number[1];
			var milliliters = number[2];
			var limes = number[3];
			var slices = number[4];
			var salt = number[5];
			var nl = number[6];
			var np = number[7];

			var totalDrink = bottles * milliliters;
			var toasts = totalDrink / nl;
			var toastsWithLimes = limes * slices;
			var toastsWithSalt = salt / np;

			Console.WriteLine(Math.Min(toasts, Math.Min(toastsWithLimes, toastsWithSalt)) / friends);
		}
	}
}

using System;

namespace ConsoleApp2
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int[] arr = new int[10];
            int size = 0;

            foreach(var tmp in Console.ReadLine().Split())
            {
                arr[size] = Convert.ToInt32(tmp);
                size++;
            }

            int n = arr[0];

            int remaining_vodka = arr[1] * arr[2];
            int remaining_limes = arr[3] * arr[4];
            int remaining_salt = arr[5];
            int vodka_for_one_tost = arr[6];
            int salt_for_one_tost = arr[7];

            int counter = 0;

            while(remaining_vodka >= (n * vodka_for_one_tost) && (remaining_salt >= n * salt_for_one_tost) && remaining_limes >= n)
            {
                remaining_vodka -= n * vodka_for_one_tost;
                remaining_salt -= n * salt_for_one_tost;
                remaining_limes-= n;
                counter++;
            }
            Console.WriteLine(counter);

        }
    }
}

using System;
using System.Linq;

namespace codeforces
{

    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int rez = Math.Min(n[1]*n[2]/n[6],Math.Min(n[3]*n[4],n[5]/n[7]))/n[0];

            Console.WriteLine(rez);

        }
    }
}

using System;
using System.Linq;
class Test {
    static public void Main(String[] args){
        string [] tmp = Console.ReadLine().Split();
        int n = Int32.Parse(tmp[0]);
        int ltotal = Int32.Parse(tmp[1])*Int32.Parse(tmp[2]);
        int limetotal = Int32.Parse(tmp[3])*Int32.Parse(tmp[4]);
        int stotal = Int32.Parse(tmp[5]);

        int nl = Int32.Parse(tmp[6]);
        int np = Int32.Parse(tmp[7]);

       int[] toasts = new int[3];
       toasts[0] = ltotal/nl;
       toasts[1] = limetotal;
       toasts[2] = stotal/np;

       int ans = (toasts.Min())/n;
       Console.WriteLine(ans);
    }
}

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

namespace softdrink
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            string[] s = a.Split(' ');
            int n, k, l, c, d, p, nl, np;
            n = Convert.ToInt16(s[0]);
            k = Convert.ToInt16(s[1]);
            l = Convert.ToInt16(s[2]);
            c = Convert.ToInt16(s[3]);
            d = Convert.ToInt16(s[4]);
            p = Convert.ToInt16(s[5]);
            nl = Convert.ToInt16(s[6]);
            np = Convert.ToInt16(s[7]);
            int totaldrink = k * l;
            int totallime = c * d;
            int totalsalt = p;
            int td = totaldrink / nl;
            int ts = totalsalt / np;
            int tl = totallime;
            int min = td;
            if (min < ts)
                min = td;
            else
                min = ts;
            if (min < tl)
                ;
            else
                min = tl;
            int result = min /n;
            Console.WriteLine(result);
            Console.ReadLine();
        }
    }
}

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

namespace CSharp_Shell
{

    public static class Program
    {
        public static void Main()
        {
          int[] inputs = Console.ReadLine().Split(' ').Select<string,int>(int.Parse).ToArray();
          int n = inputs[0];
          int k = inputs[1];
          int l = inputs[2];
          int c = inputs[3];
          int d = inputs[4];
          int p = inputs[5];
          int nl = inputs[6];
          int np = inputs[7];
          int k1 = (k*l)/nl;
          int k2 = (c*d);
          int k3 = p/np;
          int min = Math.Min(Math.Min(k1,k2),k3);
          Console.WriteLine(min/n);
        }
    }
}

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

namespace _107a
{
    class Program
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }

        }
        static void Main(string[] args)
        {
            Scanner sc = new Scanner();
            int n = sc.nextInt();
            int k = sc.nextInt();
            int l = sc.nextInt();
            int c = sc.nextInt();
            int d = sc.nextInt();
            int p = sc.nextInt();
            int nl = sc.nextInt();
            int np = sc.nextInt();

            int one = k * l / (nl * n);
            int two = (c * d) / n;
            int three = p / (np * n);

            Console.WriteLine(Math.Min(Math.Min(one, two), three));
        }
    }
}

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

namespace CodeForces
{
	internal class Template
	{
		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
			//Console.SetIn(new StreamReader(@"C:\CodeForces\input.txt"));
			new Template().Solve();
		}

		private void Solve()
		{
			var n = cin.NextInt();
			var k = cin.NextInt();
			var l = cin.NextInt();
			var c = cin.NextInt();
			var d = cin.NextInt();
			var p = cin.NextInt();
			var nl = cin.NextInt();
			var np = cin.NextInt();
			var result = Math.Min(Math.Min(k*l/nl, c*d), p/np)/n;
			Console.WriteLine(result);
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = new[] { ' ' };

		public string Next()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

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

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

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

using System;

namespace CSharp
{
    public class _151A
    {
        public static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split();

            int n = int.Parse(tokens[0]);
            int k = int.Parse(tokens[1]);
            int l = int.Parse(tokens[2]);
            int c = int.Parse(tokens[3]);
            int d = int.Parse(tokens[4]);
            int p = int.Parse(tokens[5]);
            int nl = int.Parse(tokens[6]);
            int np = int.Parse(tokens[7]);

            Console.WriteLine(Math.Min((k * l) / (n * nl), Math.Min((c * d) / n, p / (n * np))));
        }
    }
}

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

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

            string[] chysla = Console.ReadLine().Split(' ');
            int n = Int32.Parse(chysla[0]), k = Int32.Parse(chysla[1]), l = Int32.Parse(chysla[2]), c = Int32.Parse(chysla[3]), d = Int32.Parse(chysla[4]),
                p = Int32.Parse(chysla[5]), nl = Int32.Parse(chysla[6]), np = Int32.Parse(chysla[7]);
            int[] tosty = new int[3];
            tosty[0] = (k * l)/nl;
            tosty[1] = c * d;
            tosty[2] = p / np;
            int k_tostiv = tosty.Min() / n;
            Console.WriteLine(k_tostiv);

        }
    }
}

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

namespace Codeforces
{
    internal class Program
    {
        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static int[] ReadIntArray()
        {
            var input = ReadArray();
            var res = new int[input.Length];
            for (int i = 0; i < input.Length; i++)
            {
                res[i] = ReadNextInt(input, i);
            }
            return res;
        }

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

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

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        private static void Main()
        {
            var a = new List<int>(ReadIntArray());
            var res = Math.Min((a[1]*a[2])/a[6], a[3]*a[4]);
            res = Math.Min(res, a[5]/a[7]);
            Console.WriteLine(res/a[0]);
        }
    }
}

using System;

namespace Problem
{
    class Program
    {
        static void Main()
        {
            var lst = Console.ReadLine().Split(new [] {' '});
            var n = int.Parse(lst[0]);
            var k = int.Parse(lst[1]);
            var l = int.Parse(lst[2]);
            var c = int.Parse(lst[3]);
            var d = int.Parse(lst[4]);
            var p = int.Parse(lst[5]);
            var nl = int.Parse(lst[6]);
            var np = int.Parse(lst[7]);
            var lime = c*d/n;
            var salt = p/(n*np);
            var tmp = Math.Min(lime, salt);
            var gas = k*l/(nl*n);
            Console.WriteLine(Math.Min(tmp, gas));
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;

static class Problem_A
{
    static void Main(string[] args)
    {
#if TRACE
        Console.SetIn(File.OpenText("../../in.txt"));
#endif
        int[] input = Array.ConvertAll<string, int>(Console.ReadLine().Split(' '), int.Parse);
        int res = int.MaxValue;

        res = Math.Min(res, input[3] * input[4]);
        res = Math.Min(res, input[5] / input[7]);
        res = Math.Min(res, input[1] * input[2] / input[6]);

        Console.WriteLine(res / input[0]);
    }
}

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

namespace AcmSolution4
{
    class Program
    {
        private static void Do()
        {
            var a = GetInts();
            var n = a[0];
            var a1 = a[1] * a[2] / a[6];
            var a2 = a[3] * a[4];
            var a3 = a[5] / a[7];

            WL(Math.Min(a1, Math.Min(a2, a3)) / n);
        }

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

#if !ACM_HOME
            Do();
#else
            var tmp = Console.In;
            Console.SetIn(new StreamReader("a.txt"));
            while (Console.In.Peek() > 0)
            {
                Do();
                WL("Answer: " + GetStr());
            }
            Console.In.Close();
            Console.SetIn(tmp);
            Console.ReadLine();
#endif
        }

        #region Utils
        const double Epsilon = 0.00000000000001;

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

        static string[] GetStrs()
        {
            return GetStr().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        static string[] GetStrs(int cnt)
        {
            var s = new string[cnt];
            for (var i = 0; i < cnt; ++i)
                s[i] = GetStr();
            return s;
        }

        static int GetInt()
        {
            return int.Parse(GetStr());
        }

        static void GetInts(out int a, out int b)
        {
            var q = GetInts();
            a = q[0];
            b = q[1];
        }

        static int[] GetInts()
        {
            var s = GetStrs();
            var a = new int[s.Length];
            for (var i = 0; i < s.Length; ++i)
                a[i] = int.Parse(s[i]);
            return a;
        }

        static long GetLong()
        {
            return long.Parse(GetStr());
        }

        static IEnumerable<long> GetLongs()
        {
            return GetStrs().Select(long.Parse);
        }

        static void WriteDouble<T>(T d)
        {
            Console.WriteLine(string.Format("{0:0.000000000}", d).Replace(',', '.'));
        }

        static void WL<T>(T s)
        {
            Console.WriteLine(s);
        }

        static void W<T>(T s)
        {
            Console.Write(s);
        }

        static void Assert(bool b)
        {
            if (!b) throw new Exception();
        }

        static void Swap<T>(ref T a, ref T b)
        {
            var temp = a;
            a = b;
            b = temp;
        }
        #endregion
    }
}

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

namespace CodeForcesProblems.A
{
    class A115_Party
    {
        public static void Main()
        {
            //while(true)
            //{
                int n, k, l, c, d, p, nl, np;
                string[] a = Console.ReadLine().Split(' ');
                n = int.Parse(a[0]);
                k = int.Parse(a[1]);
                l = int.Parse(a[2]);
                c = int.Parse(a[3]);
                d = int.Parse(a[4]);
                p = int.Parse(a[5]);
                nl = int.Parse(a[6]);
                np = int.Parse(a[7]);
                var totalMl = k * l;
                var totalLime = c * d;
                nl *= n;
                np *= n;
                int toasts = 0;
                while(nl<=totalMl && np<=p && n<=totalLime)
                {
                    toasts++;

                    totalMl -= nl;
                    totalLime -= n;
                    p -= np;
                }
                Console.WriteLine(toasts);
           // }
        }
    }
}

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

    class Program
    {
        static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split(' ');
            int n = int.Parse(tokens[0]);
            int k = int.Parse(tokens[1]);
            int l = int.Parse(tokens[2]);
            int c = int.Parse(tokens[3]);
            int d = int.Parse(tokens[4]);
            int p = int.Parse(tokens[5]);
            int nl = int.Parse(tokens[6]);
            int np = int.Parse(tokens[7]);

            int a = k*l/nl;
            int b = c*d;
            int x = p/np;

            int res1 = Math.Min(a, b);
            int res2 = Math.Min(res1, x);
            int res = res2/n;

            Console.WriteLine(res);

        }
    }

using System;

namespace ConsoleApp27
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int n = int.Parse(s.Split(' ')[0]), k = int.Parse(s.Split(' ')[1]), l = int.Parse(s.Split(' ')[2]),
                c = int.Parse(s.Split(' ')[3]), d = int.Parse(s.Split(' ')[4]), p = int.Parse(s.Split(' ')[5]),
                nl = int.Parse(s.Split(' ')[6]), np = int.Parse(s.Split(' ')[7]);
            int tostb = k * l / nl / n;
            int tosts = p / np / n;
            int tostd = d * c / n;
            Console.WriteLine(Math.Min(Math.Min(tostb, tosts), Math.Min(tosts, tostd)));
        }
    }
}

using System;
using System.Linq;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] Aux = Console.ReadLine().Split().Select(x => Convert.ToInt32(x)).ToArray();
            int n,k,l,c,d,p,nl,np;
            n = Aux[0];
            k = Aux[1];
            l = Aux[2];
            c = Aux[3];
            d = Aux[4];
            p = Aux[5];
            nl = Aux[6];
            np = Aux[7];
            int Aux1 = (k*l)/nl;
            int Aux2 = c * d;
            int Aux3 = p / np;
            Console.WriteLine(Math.Min(Math.Min(Aux1,Aux2),Aux3)/n);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
          {
              string s;

              s = Console.ReadLine();
              string[] b = s.Split(' ');
              int[] numbers = new int[8];

              for (int i = 0; i < b.Length; i++)
              {
                  numbers[i] = int.Parse(b[i]);

              }
              int x, y, z;
              x = (numbers[1] * numbers[2]) / numbers[6];
              y = numbers[3] * numbers[4];
              z = numbers[5] / numbers[7];

             int min = x;
             if (y < min || z <min)
             {
                 if (y < z)
                     min = y;
                 else
                     min = z;
             }
           int res = min / numbers[0];
             Console.Write(res);
        }
    }
}

using System;
using System.Linq;
class a
{
    static void Main()
    {
        var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        int[] r = new int[3];
        r[0] = ((a[1] * a[2]) / a[6]);
        r[1] = (a[3] * a[4]);
        r[2] = (a[5] / a[7]);
        Console.WriteLine(r.Min() / a[0]);
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0].ToString()), k = int.Parse(s[1].ToString()), l = int.Parse(s[2].ToString()), c = int.Parse(s[3].ToString()),
                d = int.Parse(s[4].ToString()), p = int.Parse(s[5].ToString()), nl = int.Parse(s[6].ToString()), np = int.Parse(s[7].ToString());
            int kl = k * l / nl, cd = c * d, pnp = p / np;
            int[] mas = { kl, cd, pnp };
            Console.WriteLine(mas.Min() / n);
        }
    }
}

using System;
using System.Linq;

namespace NetExperiment
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] nklcdpnlnp = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            int n = nklcdpnlnp[0];
            int k = nklcdpnlnp[1];
            int l = nklcdpnlnp[2];
            int c = nklcdpnlnp[3];
            int d = nklcdpnlnp[4];
            int p = nklcdpnlnp[5];
            int nl = nklcdpnlnp[6];
            int np = nklcdpnlnp[7];

            int gas = k * l;
            int limes = c * d;
            int tost = Enumerable.Min(new int[] { gas / (n * nl), p / (n * np), limes / n });
            Console.WriteLine(tost);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, k, l, c, d, p, nl, np;
            string[] t = Console.ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            n = int.Parse(t[0]);
            k = int.Parse(t[1]);
            l = int.Parse(t[2]);
            c = int.Parse(t[3]);
            d = int.Parse(t[4]);
            p = int.Parse(t[5]);
            nl = int.Parse(t[6]);
            np = int.Parse(t[7]);
            int max = ((k * l) / (nl * n));
            int cur = (c * d) / n;
            if (cur < max)
                max = cur;
            cur = p / (np * n);
            if (cur < max)
                max = cur;
            Console.WriteLine(max);
        }
    }
}

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

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

            int n = int.Parse(tokens[0]);
            int k = int.Parse(tokens[1]);
            int l = int.Parse(tokens[2]);
            int c = int.Parse(tokens[3]);
            int d = int.Parse(tokens[4]);
            int p = int.Parse(tokens[5]);
            int nl = int.Parse(tokens[6]);
            int np = int.Parse(tokens[7]);

            int slices = c * d;
            int drink = k * l;

            int each_toast_drink = nl * n;
            int each_toast_salt = np * n;
            int each_toast_slices = n;

            int toast_num = 0;
            while(slices / each_toast_slices >= 1 && drink / each_toast_drink >= 1 && p / each_toast_salt >= 1)
            {
                toast_num++;
                slices -= each_toast_slices;
                drink -= each_toast_drink;
                p -= each_toast_salt;
            }

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

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int k= Convert.ToInt32(s[1]);
            int l= Convert.ToInt32(s[2]);
            int c = Convert.ToInt32(s[3]);
            int d = Convert.ToInt32(s[4]);
            int p = Convert.ToInt32(s[5]);
            int nl = Convert.ToInt32(s[6]);
            int np = Convert.ToInt32(s[7]);
            int[] a = new int[3];
            int gas = k * l;
            int g = gas / nl; a[0] = g;
            int lai = c * d; a[1] = lai;
            int soli = p / np; a[2] = soli;
            int min = 100000000;
            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] < min) { min = a[i]; }
            }
            Console.WriteLine(min / n);

        }
    }
}

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

namespace Pustoi
{
    class Program
    {
        static void Main(string[] args)
        {
            string str1 = Console.ReadLine();
            string[] s1 = str1.Split(' ');
            int n = Convert.ToInt32(s1[0]);
            int k = Convert.ToInt32(s1[1]);
            int l = Convert.ToInt32(s1[2]);
            int c = Convert.ToInt32(s1[3]);
            int d = Convert.ToInt32(s1[4]);
            int p = Convert.ToInt32(s1[5]);
            int nl = Convert.ToInt32(s1[6]);
            int np = Convert.ToInt32(s1[7]);
            int kl = (k * l)/nl;
            int cd = c * d;
            int p_np = p / np;
            int[] arr = new int[3];
            arr[0] = kl;
            arr[1] = cd;
            arr[2] = p_np;
            Array.Sort(arr);
            Console.WriteLine(arr[0] / n);
            Console.Read();
        }
    }
}

using System;
using System.Linq;

namespace TestProject
{
    class Program
    {
        static void Main(string[] args)
        {
            var vals = Console.ReadLine().Split(' ');
            int.TryParse(vals[0], out int n); // Кол-во людей
            int.TryParse(vals[1], out int k); // Кол-во бутылок
            int.TryParse(vals[2], out int l); // Объем 1 бутылки
            int.TryParse(vals[3], out int c); // Кол-во лаймов
            int.TryParse(vals[4], out int d); // Кол-во долек в 1 лайме
            int.TryParse(vals[5], out int p); // Кол-во соли
            int.TryParse(vals[6], out int nl); // Кол-во милилитров 1 доза, на 1 дозу 1 ломтик лайма
            int.TryParse(vals[7], out int np); // Кол-во соли 1 доза

            // Для одного тоста каждому из друзей требуется nl миллилитров газировки, одна долька лайма и np граммов соли.
            // Друзья хотят сделать как можно больше тостов, при этом все должны выпить поровну. Сколько тостов получится сделать у каждого?

            var a1 = k * l; // Общий объем газировки
            var a2 = c * d; // Общее кол-во доз долек
            var a3 = a1 / nl; // Кол-во доз газировки
            var a4 = p / np; // Кол-во доз соли

            var min = new int[] { a2, a3, a4 }.Min();

            if (min > 0)
            {
                var cnt = 0;
                while (min >= n)
                {
                    ++cnt;
                    min -= n;
                }
                Console.WriteLine(cnt);
            }
            else
            {
                Console.WriteLine(0);
            }
        }
    }
}

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

namespace temp
{
    class MainClass
    {
        private static Int32[] read_ints(int n) {
            string[] str = Console.ReadLine().Split(new char[]{' '});
            Int32[] ret = new Int32[n];
            for (Int32 i = 0; i < n; i++)
                ret[i] = Convert.ToInt32(str[i]);
            return ret;
        }

        private static Int32 read_int() {
            return Convert.ToInt32(Console.ReadLine());
        }

        private static Int64[] read_longs(int n) {
            string[] str = Console.ReadLine().Split(new char[]{' '});
            Int64[] ret = new Int64[n];
            for (Int64 i = 0; i < n; i++)
                ret[i] = Convert.ToInt64(str[i]);
            return ret;
        }

        private static Int64 read_long() {
            return Convert.ToInt64(Console.ReadLine());
        }

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

        public static void Main (string[] args)
        {
            int[] arr = read_ints(8);
            int friends = arr[0];
            int drink = arr[1]*arr[2];
            int lemons = arr[3]*arr[4];
            int salt = arr[5];
            int cnt = 0;
            while (true) {
                bool fail = false;
                for (int i = 0; i < friends; i++) {
                    if (arr[6] <= drink)
                        drink -= arr[6];
                    else {
                        fail = true;
                        break;
                    }
                    if (arr[7] <= salt)
                        salt -= arr[7];
                    else {
                        fail = true;
                        break;
                    }
                    if (lemons > 0)
                        lemons--;
                    else {
                        fail = true;
                        break;
                    }
                }
                if (fail)
                    break;
                cnt++;
            }
            Console.WriteLine(cnt);
        }
    }
}

using System;

namespace Soft_drinking_toasts_number
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] line = Console.ReadLine().Split(' ');
            int n, k, l, c, d, p, nl, np;
            n = Convert.ToInt32(line[0]);
            k = Convert.ToInt32(line[1]);
            l = Convert.ToInt32(line[2]);
            c = Convert.ToInt32(line[3]);
            d = Convert.ToInt32(line[4]);
            p = Convert.ToInt32(line[5]);
            nl = Convert.ToInt32(line[6]);
            np = Convert.ToInt32(line[7]);
            int dozeAlcool = k * l / nl;
            int feliiLamaie = c * d;
            int dozaSare = p / np;
            int a = Math.Min(dozeAlcool, dozaSare);
            int b = Math.Min(a, feliiLamaie);
            Console.WriteLine(b / n);
        }
    }
}

  using System;
  using System.Collections.Generic;
  using System.IO;

  public class pA
  {
    public static void Main ( )
    {
  #if false
      Console.SetIn ( new StreamReader ( @"e:\zin.txt" ) );
  #endif
      int x = calc ( );
      Console.WriteLine ( x );
    }

    private static int calc ( )
    {
      int[] q = ReadLineToInts ( );
      int i=0;
      int n = q[i++];
      int k = q[i++];
      int l = q[i++];
      int c = q[i++];
      int d = q[i++];
      int p = q[i++];
      int nl = q[i++];
      int np = q[i++];
      int tdrink = k * l / nl;
      int tlime = c * d;
      int tsalt = p / np;
      return Math.Min ( Math.Min ( tdrink, tlime ), tsalt ) / n;
    }

    public static int[] ReadLineToInts ( )
    {
      string line = Console.ReadLine ( );
      string[] arStrings = line.Split ( new char[] { ' ' } );

      int N = arStrings.Length;
      int[] ints = new int[N];
      for ( int i=0; i < N; i++ )
        ints[i] = int.Parse ( arStrings[i] );
      return ints;
    }

  }

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

namespace SoftDrinking
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray<int>();
            int totalMl = input[1] * input[2];
            int totalLimeSlices = input[3] * input[4];
            int salt = input[5];
            int res = 0;
            while ((totalMl - input[6]) >= 0 && (totalLimeSlices - 1) >= 0 && (salt - input[7]) >= 0)
            {
                res++;
                totalMl -= input[6];
                salt -= input[7];
                totalLimeSlices--;
            }
            Console.WriteLine(res / input[0]);
            Console.ReadLine();
        }
    }
}

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

class Program
{
    static void solve()
    {
        int[] arr = RA<int>();

        int n = arr[0], k = arr[1], l = arr[2], c = arr[3], d = arr[4], p = arr[5], nl = arr[6], np = arr[7];

        int tosts = k * l / nl;
        int laims = d * c;
        int soli = p / np;

        Console.WriteLine(Math.Min(tosts, Math.Min(laims, soli)) / n);
    }

    #region
    struct quat<T1, T2, T3, T4> { public T1 fst; public T2 snd; public T3 thr; public T4 frt;}
    struct trip<T1, T2, T3> { public T1 fst; public T2 snd; public T3 thr;}
    struct pair<T1, T2> { public T1 fst; public T2 snd;}
    static long LCM(long a, long b) { return a / GCD(a, b) * b; }
    static long GCD(long a, long b) { if (b == 0) return a; else return GCD(b, a % b); }
    static void Swap<T>(ref T a, ref T b) { T tmp = a; a = b; b = tmp; }
    static double Dist(double x1, double y1, double x2, double y2) { return Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2)); }
    static long Factorial(int n) { long ans = 1; for (int i = 2; i <= n; i++)ans *= i; return ans; }
    static void Fill<T>(T[] d, T v) { for (int i = 0; i < d.Length; i++)d[i] = v; }
    static void Fill<T>(T[,] d, T v) { for (int i = 0; i < d.GetLength(0); i++) { for (int j = 0; j < d.GetLength(1); j++) { d[i, j] = v; } } }
    static T[] RA<T>() { return RLine().Split().Select(v => (T)Convert.ChangeType(v, typeof(T))).ToArray(); }

    static void Main()
    {
#if DEBUG
        StreamWriter fout;
        Console.SetIn(new StreamReader("input.txt"));
        Console.SetOut(fout = new StreamWriter("output.txt"));
#endif
        solve();
#if DEBUG
        fout.Close();
#endif
    }

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

    static int RC()
    {
        return Console.Read();
    }

    static double RD()
    {
        bool m = false;
        double val = 0;
        int c = 0, r = 1;
        while (((c = Console.Read()) < '0' || c > '9') && c != '-')
        {
        }
        val = (c >= '0' && c <= '9') ? c - 48 : (c == '-' ? m = true : m = false) ? 0 : 0;
        while ((c = Console.Read()) >= '0' && c <= '9')
            val = val * 10 + (m ? -(c - 48) : (c - 48));
        if (c == '.')
            while ((c = Console.Read()) >= '0' && c <= '9')
            {
                val += ((double)(c - 48)) / (r *= 10);
            }

        return val;
    }

    static long RL()
    {
        long val = 0;
        bool m = false;
        int c;
        while (((c = Console.Read()) < '0' || c > '9') && c != '-')
        {
        }
        val = (c >= '0' && c <= '9') ? c - 48 : (c == '-' ? m = true : m = false) ? 0 : 0;
        while ((c = Console.Read() - 48) >= 0 && c <= 9)
            val = val * 10 + (m ? -c : c);
        return val;
    }

    static int RI()
    {
        bool m = false;
        int val = 0, c;
        while (((c = Console.Read()) < '0' || c > '9') && c != '-')
        {
        }
        val = (c >= '0' && c <= '9') ? c - 48 : (c == '-' ? m = true : m = false) ? 0 : 0;
        while ((c = Console.Read() - 48) >= 0 && c <= 9)
            val = val * 10 + (m ? -c : c);
        return val;
    }
}
    #endregion

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

public class CasketOfStar
{
public static void Main(string[] args)
    {
        string str = Console.ReadLine();
        int [] arr = str.Split().Select(s => int.Parse(s)).ToArray();
        int t1 = ((arr[1] * arr[2]) / arr[6]) / arr[0];
        int t2 = (arr[5] / arr[7]) / arr[0];
        int t3 = (arr[3] * arr[4]) / arr[0];
        Console.WriteLine(Math.Min(Math.Min(t1,t2),t3));
    }

}

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

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine().Trim();
            List<int> arr = s.Split(' ').Select(str => int.Parse(str)).ToList();

            int n = arr[0];
            int k = arr[1];
            int l = arr[2];
            int c = arr[3];
            int d = arr[4];
            int p = arr[5];
            int nl = arr[6];
            int np = arr[7];

            int vol = k * l;

            int tostCount = vol / nl;
            int tostCount2 = c * d;
            int tostCount3 = p / np;

            tostCount = Math.Min(tostCount3, Math.Min(tostCount2, tostCount));

            int res = tostCount / n;
            Console.WriteLine(res);
        }
    }
}

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

namespace ConsoleApplication10
{
    class Program
    {
        static void Main(string[] args) {
            string[] input = Console.ReadLine().Split(' ');
            int n = int.Parse(input[0]);
            int k = int.Parse(input[1]);
            int l = int.Parse(input[2]);
            int c = int.Parse(input[3]);
            int d = int.Parse(input[4]);
            int p = int.Parse(input[5]);
            int nl = int.Parse(input[6]);
            int np = int.Parse(input[7]);

            int lReal = k * l;
            int dReal = c * d;
            int pReal = p;

            int lNum = lReal / nl / n;
            int dNum = dReal / 1  / n;
            int pNum = pReal / np / n;

            int count = Math.Min(lNum,Math.Min(dNum,pNum));
            Console.WriteLine(count);
        }
    }
}

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

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

                string input;
                input = Console.ReadLine();
                string[] split = input.Split(' ');
                int []Constraint=new int[split.Length];
                for (int i = 0; i < split.Length; i++)
                {
                    Constraint[i] = Convert.ToInt32( split[i]);
                }

                int mmOfdrinks = Constraint[1] * Constraint[2];
                int numberOFtoasts = mmOfdrinks / Constraint[6];
                int limes = Constraint[3] * Constraint[4];
                int salt = Constraint[5] / Constraint[7];
                List<int> iList = new List<int>();
                iList.Add(numberOFtoasts);
                iList.Add(limes);
                iList.Add(salt);
                int min = iList.Min();
                min /= Constraint[0];
                Console.WriteLine(min.ToString());

            }

        }
    }

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

namespace Soft_Drinking
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] r = Console.ReadLine().Split(' ');
            int n = int.Parse(r[0]);
            int k = int.Parse(r[1]);
            int l = int.Parse(r[2]);
            int c = int.Parse(r[3]);
            int d = int.Parse(r[4]);
            int p = int.Parse(r[5]);
            int nl = int.Parse(r[6]);
            int np = int.Parse(r[7]);
            int br = Math.Min(Math.Min(k * l / nl, c * d), p / np);
            Console.WriteLine(br / n);
        }
    }
}

using System;

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

            int n = int.Parse(s[0]);
            int k = int.Parse(s[1]);
            int l = int.Parse(s[2]);
            int c = int.Parse(s[3]);
            int d = int.Parse(s[4]);
            int p = int.Parse(s[5]);
            int nl = int.Parse(s[6]);
            int np = int.Parse(s[7]);

           int min1= Math.Min((k * l) / nl, c*d);
           int min2 = Math.Min(min1, p/np);
            Console.WriteLine(min2/n);

        }
    }
}

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

namespace Task
{

    #region MyIo

    internal class MyIo : IDisposable
    {
        private readonly TextReader inputStream;
        private readonly TextWriter outputStream = Console.Out;

        private string[] tokens;
        private int pointer;

        public MyIo()
#if  LOCAL_TEST
            : this(new StreamReader("input.txt"))
#else
            : this(System.Console.In)
#endif
        {

        }

        public MyIo(TextReader inputStream)
        {
            this.inputStream = inputStream;
        }

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return int.Parse(NextString());
        }

        public long NextLong()
        {
            return long.Parse(NextString());
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));
        }

        public void PrintLine(string format, params object[] args)
        {
            Print(format, args);

            outputStream.WriteLine();
        }

        public void Print(bool o)
        {
            Print(o ? "YES" : "NO");
        }

        public void PrintLine(bool o)
        {
            PrintLine(o ? "YES" : "NO");
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }

        void IDisposable.Dispose()
        {
            Close();

#if  LOCAL_TEST
            Console.ReadLine();
#endif
        }
    }

    #endregion

    internal class Program
    {
        #region Program

        private readonly MyIo io;

        public Program(MyIo io)
        {
            this.io = io;
        }

        public static void Main(string[] args)
        {
            using (MyIo io = new MyIo())
            {
                new Program(io)
                    .Solve();
            }
        }

        public static class P
        {
            public static P<T1, T2> Create<T1, T2>(T1 key, T2 val)
            {
                return new P<T1, T2>(key, val);
            }
        }

        public class P<T1, T2>
        {
            private class PComparer : IComparer<P<T1, T2>>
            {
                private readonly bool byKey;

                public PComparer(bool byKey)
                {
                    this.byKey = byKey;
                }

                public int Compare(P<T1, T2> x, P<T1, T2> y)
                {
                    x = x ?? new P<T1, T2>();
                    y = y ?? new P<T1, T2>();

                    if (byKey)
                        return Comparer<T1>.Default.Compare(x.Key, y.Key);
                    else
                        return Comparer<T2>.Default.Compare(x.Value, y.Value);
                }
            }

            public P()
            {
            }

            public P(T1 key, T2 val)
            {
                this.Key = key;
                this.Value = val;
            }

            public T1 Key
            {
                get;
                set;
            }

            public T2 Value
            {
                get;
                set;
            }

            public P<T1, T2> Clone()
            {
                return new P<T1, T2>(Key, Value);
            }

            public static IComparer<P<T1, T2>> KeyComparer
            {
                get { return new PComparer(true); }
            }

            public static IComparer<P<T1, T2>> ValueComparer
            {
                get { return new PComparer(false); }
            }

            public static implicit operator T1(P<T1, T2> obj)
            {
                return obj.Key;
            }

            public static implicit operator T2(P<T1, T2> obj)
            {
                return obj.Value;
            }

            public P<T1, T2> SetKey(T1 key)
            {
                Key = key;
                return this;
            }

            public P<T1, T2> SetValue(T2 value)
            {
                Value = value;
                return this;
            }

            public override string ToString()
            {
                return string.Format("Key: {0}, Value: {1}", Key, Value);
            }
        }

        #endregion

        private void Solve()
        {
            var n = io.NextInt();
            var k = io.NextInt();
            var l = io.NextInt();
            var c = io.NextInt();
            var d = io.NextInt();
            var p = io.NextInt();
            var nl = io.NextInt();
            var np = io.NextInt();

            var kl = ((k * l) / nl) / n;
            var cd = (c * d) / n;
            var pnp = (p / np) / n;

            io.Print(Math.Min(kl, Math.Min(cd, pnp)));
        }
    }

}

using System;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {

        static void Main( )
        {
            string input = Console.ReadLine();
            string[] separ = new string[] {" "};
            string[] resulting = input.Split(separ, StringSplitOptions.None);
            uint[] mas = new uint[8];
            for (int i = 0; i < 8; i++)
            {
                mas[i] = uint.Parse(resulting[i]);
            }
            Console.WriteLine(Math.Min(Math.Min(mas[1]*mas[2]/mas[6],mas[3]*mas[4]), mas[5]/mas[7])/mas[0]);
            Console.ReadLine();
        }
    }
}

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

namespace pr
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] data = Array.ConvertAll<string, int>(Console.ReadLine().Split(' '), x => int.Parse(x));
            int n = data[0];
            int k = data[1];
            int l = data[2];
            int c = data[3];
            int d = data[4];
            int p = data[5];
            int nl = data[6];
            int np = data[7];
            int t1 = (k * l) / nl;
            int t2 = c * d;
            int t3 = p / np;
            Console.WriteLine((Min(Min(t1,t2), t3))/n);

        }

        static int Min(int a, int b)
        {
            return a < b ? a : b;
        }
    }

}

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

namespace Soft_Drinking
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] values = Console.ReadLine().Split(' ');
            int[] val = new int[values.Length];
            for (int i = 0; i < values.Length; i++)
                val[i] = Convert.ToInt32(values[i]);
            int shots = (val[2] * val[1]) / val[6];
            int limes = val[3] * val[4];
            int salts = val[5] / val[7];
            int min = int.MaxValue;
            if (shots < min)
                min = shots;
            if (salts < min)
                min = salts;
            if (limes < min)
                min = limes;
            Console.WriteLine(min/val[0]);
            Console.Read();
        }
    }
}

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

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.v2.TaskV2Attribute]
#endif
	class Task151A
	{
		private class Solver
		{
			private InputTokenizer input = new InputTokenizer();
			private TextWriter output = Console.Out;

			public void Solve()
			{
				int n, k, l, c, d, p, nl, np;
				input.Line().Read(out n).Read(out k).Read(out l).Read(out c).Read(out d).Read(out p).Read(out nl).Read(out np);

				output.WriteLine(Math.Min(Math.Min(k * l / nl, c * d), p / np) / n);
			}
		}

		#region
		public static void Main()
		{
			var obj = new Solver();
			obj.Solve();
		}

		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public String ReadLine()
			{
				return Console.In.ReadLine();
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

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

namespace Crap
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] tmp1 = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(tmp1[0]);
            int k = Convert.ToInt32(tmp1[1]);
            int l = Convert.ToInt32(tmp1[2]);
            int c = Convert.ToInt32(tmp1[3]);
            int d = Convert.ToInt32(tmp1[4]);
            int p = Convert.ToInt32(tmp1[5]);
            int nl = Convert.ToInt32(tmp1[6]);
            int np = Convert.ToInt32(tmp1[7]);

            int bottleToasts = (k * l) / nl;
            int limeToasts = (c * d);
            int saltToasts = (p) / np;
            int tmp = Math.Min(limeToasts, saltToasts);
            Console.WriteLine((Math.Min(bottleToasts, tmp))/n);
        }
    }
}

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

namespace ConsoleApplication5
{
    class Program
    {
        static int Min(int a, int b, int c)
        {
            if (a <= b && a <= c)
                return a;
            else if (b <= a && b <= c)
                return b;
            else
                return c;
        }

        static void Main()
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int k = Convert.ToInt32(s[1]);
            int l = Convert.ToInt32(s[2]);
            int c = Convert.ToInt32(s[3]);
            int d = Convert.ToInt32(s[4]);
            int p = Convert.ToInt32(s[5]);
            int nl = Convert.ToInt32(s[6]);
            int np = Convert.ToInt32(s[7]);

            int tostov = 0;

            int gazirovki = (k * l)/nl;
            int limon = c * d;
            int soli = p / np;

            tostov = Min(gazirovki, limon, soli)/n;
            Console.WriteLine(tostov);

        }
    }
}

using System;
class Codeforce
{
     static void Main()
    {
      string []s= Console.ReadLine().Split();

      int n=int.Parse(s[0]);
      int k=int.Parse(s[1]);
      int l=int.Parse(s[2]);
      int c=int.Parse(s[3]);
      int d=int.Parse(s[4]);
      int p=int.Parse(s[5]);
      int nl=int.Parse(s[6]);
      int np=int.Parse(s[7]);

      Console.WriteLine(Math.Min(Math.Min(k*l/nl,c*d),p/np)/n);

    }
}

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

namespace _151A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            int n = a[0], k = a[1], l = a[2], c = a[3], d = a[4], p = a[5], nl = a[6], np = a[7];
            int x1 = k * l / nl, x2 = c * d, x3 = p / np;
            Console.WriteLine(Math.Min(x1, Math.Min(x2, x3)) / n);
        }
    }
}

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

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);
            int n = a[0], k = a[1], l = a[2], c = a[3], d = a[4], p = a[5], nl = a[6], np = a[7];
            Console.WriteLine(Math.Min(k * l / nl, Math.Min(c * d, p / np))/n);
        }
    }
}

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

namespace CF107
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine().Split(' ');
            int n = int.Parse(tokens[0]);
            int k = int.Parse(tokens[1]);
            int l = int.Parse(tokens[2]);
            int c = int.Parse(tokens[3]);
            int d = int.Parse(tokens[4]);
            int p = int.Parse(tokens[5]);
            int nl = int.Parse(tokens[6]);
            int np = int.Parse(tokens[7]);

            int bound1 = (k * l) / nl;
            int bound2 = (c * d);
            int bound3 = p / np;

            int answer = Math.Min(Math.Min(bound1, bound2), bound3) / n;
            Console.WriteLine(answer);
        }
    }
}

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

namespace CFContest
{
    class Program
    {
        static void Main(string[] args)
        {
            String[] arr = Console.ReadLine().Split(' ');
            int n = Int32.Parse(arr[0]);
            int k = Int32.Parse(arr[1]);
            int l = Int32.Parse(arr[2]);
            int c = Int32.Parse(arr[3]);
            int d = Int32.Parse(arr[4]);
            int p = Int32.Parse(arr[5]);
            int nl = Int32.Parse(arr[6]);
            int np = Int32.Parse(arr[7]);

            Console.WriteLine(Math.Min(Math.Min(k * l / nl, c * d), p / np) / n);
        }
    }
}

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

namespace ConsoleApp5
{
    public class Program
    {
        static void Main()
        {
            var s = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var res = Min(s[1] * s[2] / s[6], s[3] * s[4], s[5] / s[7]) / s[0];
            Console.WriteLine(res);
        }
        static int Min(int a, int b, int c)
        {
            return Math.Min(Math.Min(a, b), c);
        }
    }
}

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

public class A
{
    public partial class Myon
    {

        static void Main()
        {
            A p = new A();
            p.solve();
        }

    }

    public void solve()
    {
        int[] tmp = intSplit(' ');
        int n = tmp[0];
        int k = tmp[1];
        int l = tmp[2];
        int c = tmp[3];
        int d = tmp[4];
        int p = tmp[5];
        int nl = tmp[6];
        int np = tmp[7];

        int res = int.MaxValue;
        res = Math.Min(res,k * l / nl);
        res = Math.Min(res, c * d);
        res = Math.Min(res,p / np);
        Console.WriteLine(res/n);

    }

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

    int intRead()
    { return int.Parse(Console.ReadLine()); }

    long longRead()
    { return long.Parse(Console.ReadLine()); }

    string[] stringSplit(char a)
    { return Console.ReadLine().Split(a); }

    int[] intSplit(char a)
    { return Array.ConvertAll<string, int>(Console.ReadLine().Split(a), int.Parse); }

    long[] longSplit(char a)
    { return Array.ConvertAll<string, long>(Console.ReadLine().Split(a), long.Parse); }

    void write(string str)
    {
        Console.WriteLine(str);
    }

}

using System;

namespace SoftDrinking
{
    class Program
    {
        static void Main(string[] args)
        {
            string [] input = Console.ReadLine().Split(new char[]{' '}, StringSplitOptions.None);

            int n = int.Parse(input[0]);
            int k = int.Parse(input[1]);
            int l = int.Parse(input[2]);
            int c = int.Parse(input[3]);
            int d = int.Parse(input[4]);
            int p = int.Parse(input[5]);
            int nl = int.Parse(input[6]);
            int np = int.Parse(input[7]);

            Console.WriteLine( Math.Min(Math.Min((k*l)/nl, c*d), p/np) / n);
        }
    }
}

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

namespace A.Газировкопитие
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int k = Convert.ToInt32(s[1]);
            int l = Convert.ToInt32(s[2]);
            int c = Convert.ToInt32(s[3]);
            int d = Convert.ToInt32(s[4]);
            int p = Convert.ToInt32(s[5]);
            int nl = Convert.ToInt32(s[6]);
            int np = Convert.ToInt32(s[7]);
            int gaz = (k * l) / nl;
            int lime = c * d;
            int salt = p / np;
            Tosti(gaz,lime,salt,n);
        }

        static void Tosti(int gaz, int lime, int salt, int chelov)
        {
            int min1=1000000;
            int[] min = new int[3];
            min[0] = gaz;
            min[1] = lime;
            min[2] = salt;
            for (int i = 0; i < 3; i++)
                if (min[i] < min1)
                    min1 = min[i];
            Console.WriteLine(min1/chelov);
        }

    }
}

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

class Program
{
    //2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
    static void Main(string[] args)
    {

        string input = Console.ReadLine();

        string[] results = input.Split(' ');

        List<int> num = new List<int>();

        foreach( var r in results)
        {
            num.Add(Convert.ToInt32(r));
        }

        int value1 = num[1] * num[2] / num[6];
        int value2 = num[3] * num[4];
        int value3 = num[5] / num[7];

        Console.WriteLine(Math.Min(Math.Min(value1, value2), value3) / num[0]);

    }
}

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

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();
			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input4.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

			long n = inputs1[0];
			long k = inputs1[1];
			long l = inputs1[2];
			long c = inputs1[3];
			long d = inputs1[4];
			long p = inputs1[5];
			long nl = inputs1[6];
			long np = inputs1[7];

			long gaz = (k * l) / (n * nl);
			long lime = (c * d) / n;
			long salt = p / (n * np);

			Console.WriteLine(Math.Min(gaz, Math.Min(lime, salt)));
		}

		public class Node
		{
			public int Count { get; set; }

			public int FirstIndex { get; set; } = -1;

			public int LastIndex { get; set; } = -1;
		}

		//public class Node<T>
		//{
		//	public Node<T> Left { get; set; }

		//	public Node<T> Right { get; set; }

		//	public T Value { get; set; }

		//	public Node(T value)
		//	{
		//		Value = value;
		//	}
		//}

		//public class Tree<T>
		//{
		//	public Node<T> Root { get; set; }

		//	public Tree(T value)
		//	{
		//		Root = new Node<T>(value);
		//	}
		//}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

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

namespace Task
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] iData = Console.ReadLine().Split(' ').Select(it => Convert.ToInt32(it)).ToArray();

            List<int> lst = new List<int>();
            int iCountTostGas = (iData[1] * iData[2]) / iData[6];
            lst.Add(iCountTostGas);
            int iCountTostLaim = iData[3] * iData[4];
            lst.Add(iCountTostLaim);
            int iCountTostSolt = iData[5] / iData[7];
            lst.Add(iCountTostSolt);

            int iCountTost = lst.Min() / iData[0];

            Console.WriteLine(iCountTost);

        }
    }
}

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

namespace CR_111_A
{
    class Program
    {

        static void Main()
        {
            string[] tmp = Console.ReadLine().Split(' ');
            int n = int.Parse(tmp[0]);
            int k = int.Parse(tmp[1]);
            int l = int.Parse(tmp[2]);
            int c = int.Parse(tmp[3]);
            int d = int.Parse(tmp[4]);
            int p = int.Parse(tmp[5]);
            int nl = int.Parse(tmp[6]);
            int np = int.Parse(tmp[7]);
            int temp = (k * l / nl) ;
            int temp1 = c*d ;
            int temp2 = (p / np) ;
            int buf = Math.Min(temp, temp1);
            int ans = Math.Min(buf, temp2);
            Console.WriteLine((int)ans/n);
        }
    }
}

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

namespace SimpleProblem
{
    class Program
    {
        static void Main(string[] args)
        {
            //int n = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');

            int n = int.Parse(s[0].ToString());
            int k = int.Parse(s[1].ToString());
            int l = int.Parse(s[2].ToString());
            int c = int.Parse(s[3].ToString());
            int d = int.Parse(s[4].ToString());
            int p = int.Parse(s[5].ToString());
            int nl = int.Parse(s[6].ToString());
            int np = int.Parse(s[7].ToString());

            int T = k * l / (n*nl);
            int Z = c * d / n;
            int P = p / (np*n);

            Console.WriteLine(Math.Min(Math.Min(T,Z),P));

            // Console.ReadLine();

        }
    }
}

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

namespace Codeforces98
{
	class A107
	{
		static void Main(string[] args)
		{
			int ans = 0;
			string[] ss = Console.ReadLine().Split(' ');

			int  n = int.Parse(ss[0]);
			int  k = int.Parse(ss[1]);
			int  l = int.Parse(ss[2]);
			int  c = int.Parse(ss[3]);
			int  d = int.Parse(ss[4]);
			int  p = int.Parse(ss[5]);
			int nl = int.Parse(ss[6]);
			int np = int.Parse(ss[7]);

			int a1 = k * l / (n*nl);
			int a2 = c*d / n;
			int a3 = p / (np*n);

			if (a1 > a2)
				a1 = a2;
			if (a1 > a3)
				a1 = a3;

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

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

//long a = long.Parse(Console.In.ReadLine());
//int a = int.Parse(Console.In.ReadLine());

//string[] ss = Console.In.ReadLine().Split(new char[] { ' ' });
//long l = long.Parse(ss[0]);
//int l = int.Parse(ss[0]);

class temp
{
    static void Main()
    {
        new temp().myMain();
    }

    void myMain()
    {
        //Console.SetIn(new StreamReader(new FileStream("../../in.txt", FileMode.Open)));
        //StreamWriter out_sw = new StreamWriter(new FileStream("../../out.txt", FileMode.Create));
        //Console.SetOut(out_sw);

        string[] ss = Console.In.ReadLine().Split(new char[] { ' ' });
        int n = int.Parse(ss[0]);
        int k = int.Parse(ss[1]);
        int l = int.Parse(ss[2]);
        int c = int.Parse(ss[3]);
        int d = int.Parse(ss[4]);
        int p = int.Parse(ss[5]);
        int nl = int.Parse(ss[6]);
        int np = int.Parse(ss[7]);

        int val1 = (k * l)/nl;
        int val2 = c * d;
        int val3 = p / np;

        int min = val1;
        if (val2 < min) min = val2;
        if (val3 < min) min = val3;

        int res = min / n;

        Console.Out.WriteLine(res);
        //out_sw.Close();
    }
}

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

namespace Temp
{
    using System.IO;

    static class Algebra
    {
        public static long Phi(long n)
        {
            long result = n;
            for (long i = 2; i * i <= n; i++)
            {
                if (n % i == 0)
                {
                    while (n % i == 0)
                    {
                        n /= i;
                    }

                    result -= result / i;
                }
            }

            if (n > 1)
            {
                result -= result / n;
            }

            return result;
        }

        public static long BinPower(long a, long n, long mod)
        {
            long result = 1;

            while (n > 0)
            {
                if ((n & 1) != 0)
                {
                    result = (result * a) % mod;
                }

                a = (a * a) % mod;
                n >>= 1;
            }

            return result;
        }

        public static long Gcd(long a, long b)
        {
            return b == 0 ? a : Gcd(b, a % b);
        }

        public static long ExtendedGcd(long a, long b, out long x, out long y)
        {
            if (b == 0)
            {
                x = 1;
                y = 0;
                return a;
            }

            long x1;
            long y1;
            long d = ExtendedGcd(b, a % b, out x1, out y1);
            x = y1;
            y = x1 - (a / b) * y1;
            return d;
        }

        public static long Lcm(long a, long b)
        {
            return (a / Gcd(a, b)) * b;
        }

        public static bool[] GetPrimes(int n)
        {
            n = Math.Max(n, 2);
            bool[] prime = new bool[n + 1];
            for (int i = 2; i <= n; i++)
            {
                prime[i] = true;
            }

            for (int i = 2; i * i <= n; i++)
            {
                if (prime[i])
                {
                    if ((long)i * i <= n)
                    {
                        for (int j = i * i; j <= n; j += i)
                        {
                            prime[j] = false;
                        }
                    }
                }
            }

            return prime;
        }
    }

    static class Reader
    {
        public static void ReadInt(out int a)
        {
            int[] number = new int[1];
            ReadInt(number);
            a = number[0];
        }

        public static void ReadInt(out int a, out int b)
        {
            int[] numbers = new int[2];
            ReadInt(numbers);
            a = numbers[0];
            b = numbers[1];
        }

        public static void ReadInt(int[] numbers)
        {
            var list = Console.ReadLine().Split();

            int count = Math.Min(numbers.Length, list.Length);

            for (int i = 0; i < count; i++)
            {
                numbers[i] = int.Parse(list[i]);
            }
        }
    }

    static class MyMath
    {
        public static int GetMinimalPrimeDivisor(int n)
        {
            for (int i = 2; i * i <= n; i++)
            {
                if (n % i == 0)
                {
                    return i;
                }
            }

            return n;
        }
    }

    public interface IGraph
    {
        int Vertices  { get; set; }

        IList<int> this[int i] { get; }

        void AddEdge(int u, int v);

        void AddOrientedEdge(int u, int v);
    }

    public class Graph : IGraph
    {
        private List<int>[] m_Edges;

        public int Vertices { get; set; }

        public IList<int> this[int i]
        {
            get
            {
                return this.m_Edges[i];
            }
        }

        public Graph(int vertices)
        {
            this.Vertices = vertices;

            this.m_Edges = new List<int>[vertices];

            for (int i = 0; i < vertices; i++)
            {
                this.m_Edges[i] = new List<int>();
            }
        }

        public void AddEdge(int u, int v)
        {
            this.AddOrientedEdge(u, v);
            this.AddOrientedEdge(v, u);
        }

        public void AddOrientedEdge(int first, int second)
        {
            this.m_Edges[first].Add(second);
        }
    }

    class Program
    {
        static void Main()
        {
            new Solution().Solve();
        }
    }

    class Solution
    {
        private int n, k, l, c, d, p, nl, np;

        public void Solve()
        {
            //DirectToFiles();

            int[] a = new int[8];
            Reader.ReadInt(a);
            n = a[0];
            k = a[1];
            l = a[2];
            c = a[3];
            d = a[4];
            p = a[5];
            nl = a[6];
            np = a[7];

            int x1 = (k * l) / (n * nl);
            int x2 = (c * d) / n;
            int x3 = p / (n * np);

            int answer = Math.Min(x1, Math.Min(x2, x3));

            Console.WriteLine(answer);

            //CloseFiles();
        }

        private StreamReader InputStream;

        private StreamWriter OutStream;

        private void DirectToFiles()
        {
            InputStream = File.OpenText("input.txt");
            Console.SetIn(InputStream);
            OutStream = File.CreateText("output.txt");
            Console.SetOut(OutStream);
        }

        private void CloseFiles()
        {
            OutStream.Flush();

            InputStream.Dispose();
            OutStream.Dispose();
        }
    }
}

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

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

            int n, k, l, c, d, p, nl, np,drink, slice, salt, ans;
            var line = Console.ReadLine();
            var num = line.Split(' ');
            n = int.Parse(num[0]);
            k= int.Parse(num[1]);
            l= int.Parse(num[2]);
            c= int.Parse(num[3]);
            d= int.Parse(num[4]);
            p= int.Parse(num[5]);
           nl= int.Parse(num[6]);
           np= int.Parse(num[7]);

            drink = (k * l) / nl;
            slice = (c * d);
            salt = p / np;
            ans =Math.Min(slice, salt);
            ans =Math.Min(ans, drink);
            ans /= n;
            Console.WriteLine(ans);
        }
    }
}

using System;
public class Program
    {
        public static void Main(string[] args)
        {
            int n;
            {
                string[] input = Console.In.ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                n = int.Parse(input[0]);
                n=Math.Min(Math.Min((int.Parse(input[3]) * int.Parse(input[4])), int.Parse(input[1]) * int.Parse(input[2])/int.Parse(input[6])),
                int.Parse(input[5]) / int.Parse(input[7]))/n;
            }
            Console.WriteLine(n);
        }
    }

using System;
class MyBuild
{
    static void Main()
    {

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

        int milliliters = numsin[1] * numsin[2];
        int totalslices = numsin[3] * numsin[4];
        int salt = numsin[5];

        int toastchecker = 3;
        int toastcounter = -1;

        while (toastchecker ==3)
        {
            toastchecker = 0;

            milliliters -= numsin[0] * numsin[6];
            totalslices -= numsin[0];
            salt -= numsin[0] * numsin[7];

            if (milliliters >= 0)
            {
                toastchecker++;
            }
            if (totalslices >= 0)
            {
                toastchecker++;
            }
            if (salt >= 0)
            {
                toastchecker++;
            }

            toastcounter++;
        }

        Console.WriteLine(toastcounter);

    }
}

using System;

class A151 {
    static int Min3(int a1, int a2, int a3) {
        return Math.Min(a1, Math.Min(a2, a3));
    }

    public static void Main() {
        var line = Console.ReadLine().Split();
        var n = int.Parse(line[0]);
        var k = int.Parse(line[1]);
        var l = int.Parse(line[2]);
        var c = int.Parse(line[3]);
        var d = int.Parse(line[4]);
        var p = int.Parse(line[5]);
        var nl = int.Parse(line[6]);
        var np = int.Parse(line[7]);
        Console.WriteLine(Min3(k * l / nl, c * d, p / np) / n);
    }
}

using System;
using System.Linq;
class Demo
{
    static void Main()
    {
        var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Console.WriteLine(Math.Min((int)a[1] * a[2] / (a[6] * a[0]), Math.Min((int)a[3] * a[4] / a[0], (int)a[5] / (a[7] * a[0]))));

    }
}

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

namespace Pr1
{
    class Program
    {
        static void Main()
        {
            var ab= Array.ConvertAll(Console.ReadLine().Split(' '), Convert.ToInt64);

            Console.Write(Math.Min(Math.Min(ab[1]*ab[2]/ab[0]/ab[6],ab[3]*ab[4]/ab[0]),ab[5]/ab[0]/ab[7]));
        }
    }
}

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 [] {k*l/nl, c*d, p/np}.Min() / n);
  }
}

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

namespace CSharp_Contests
{
    public class Program
    {
        public static void Main() {
            //n, k, l, c, d, p, nl, np
            uint[] n = Console.ReadLine().Split(new char[1] { ' ' }).Select(a => uint.Parse(a)).ToArray();
            Console.WriteLine(Math.Min(Math.Min(( n[1] * n[2] ) / n[6], n[3] * n[4]), n[5] / n[7]) / n[0]);

#if DEBUG
            Console.ReadLine();
#endif
        }
    }
}

using System;
using System.IO;
using System.Linq;

class Program
{
    static char[] SPACE = new[] { ' ' };

    static void Main(string[] args)
    {
#if DEBUG
        using (var input = new StreamReader("input.txt"))
        using (var output = new StreamWriter("output.txt"))
        {
            Console.SetIn(input);
            Console.SetOut(output);

            int n = 0;
            do
            {
                Console.WriteLine();
                Console.WriteLine("Sample {0}", ++n);
                Prog();
            } while (Console.ReadLine() == string.Empty);
        }
#else
            Prog();
#endif
    }

    static int __ptr = 0;
    static string[] __input;
    static int NextInt()
    {
        return int.Parse(__input[__ptr++]);
    }
    static long NextLong()
    {
        return long.Parse(__input[__ptr++]);
    }
    static void ReadTokens(int n)
    {
        __ptr = 0;
        __input = Console.ReadLine().Split(SPACE, n);
    }

    //

    static void Prog()
    {
        // n, k, l, c, d, p, nl, np

        ReadTokens(8);
        int n = NextInt();
        int k = NextInt();
        int l = NextInt();
        int c = NextInt();
        int d = NextInt();
        int p = NextInt();
        int nl = NextInt();
        int np = NextInt();

        Console.WriteLine(Math.Min(Math.Min(k * l / nl / n, c * d / n), p / np / n));

        /*
        ReadTokens(1);
        int n = NextInt();

        for (int i = 0; i < n; i++)
        {
            var s = Console.ReadLine();

            bool b = false;
            int bIndex = 1;

            if (char.IsLetter(s[0]) && char.IsNumber(s[1]))
            {
                for (int j = 2; j < s.Length; j++)
                {
                    if (char.IsLetter(s[j]))
                    {
                        b = true;
                        bIndex = j;
                        break;
                    }
                }
            }

            if (b)
            {
                int a = int.Parse(s.Substring(1, bIndex - 1));
                int bb = int.Parse(s.Substring(bIndex + 1));

                Console.Write(bb);
                Console.Write(' ');
                Console.Write(To26(bb));
                Console.Write(' ');
                Console.Write(a);
            }
            else
            {

            }

        }
        */
    }

}

using System;

namespace _151A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] x = Console.ReadLine().Split(' ');
            int m = 0, y = 0, z = 0, k = 0;
            m = int.Parse(x[1]) * int.Parse(x[2]);
            y = m / int.Parse(x[6]);
            z = int.Parse(x[3]) * int.Parse(x[4]);
            k = int.Parse(x[5]) / int.Parse(x[7]);
            if (y<z&&y<k)
            {
                Console.WriteLine(y/ int.Parse(x[0]));
            }
            else if (z<y&&z<k)
            {
                Console.WriteLine(z/ int.Parse(x[0]));
            }
            else
            {
                Console.WriteLine(k / int.Parse(x[0]));
            }
        }
    }
}

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

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

        private static void Main(string[] args)
        {
            int n = Next(), k = Next(), l = Next(), c = Next(), d = Next(), p = Next(), nl = Next(), np = Next();

            var nn = new int[n];
            for (int i = 0; i < n; i++)
            {
                nn[i] = Next();
            }

            writer.WriteLine(Math.Min(Math.Min(k*l/nl, p/np), c*d)/n);
            writer.Flush();
        }

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

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

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

        private static void Main(string[] args)
        {
            int n = Next(), k = Next(), l = Next(), c = Next(), d = Next(), p = Next(), nl = Next(), np = Next();

            writer.WriteLine(Math.Min(Math.Min(k*l/nl, p/np), c*d)/n);
            writer.Flush();
        }

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

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

namespace softdrinking
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);
            int[] b = new int[3];
            b[0] = (a[1] * a[2]) / a[6];
            b[1] = a[5] / a[7];
            b[2] = (a[3] * a[4]);
            Console.WriteLine(b.Min() / a[0]);
            Console.ReadLine();
        }
    }
}

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

namespace probleme {
    class Program {
        static void Main(string[] args) {
            //Console.SetIn(new StreamReader("file.txt"));
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]), k = int.Parse(s[1]), l = int.Parse(s[2]), c = int.Parse(s[3]), d = int.Parse(s[4]), p = int.Parse(s[5]), nl = int.Parse(s[6]), np = int.Parse(s[7]);
            int ans = Math.Min(k * l / nl, Math.Min(c * d, p / np)) / n;
            Console.Write(ans);
            //Console.ReadKey();
        }
    }
}

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

namespace CodeForces.PRACTICE
{
    // Soft Drinking (implementation)
    class _151A
    {
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            int n = int.Parse(ss[0]);
            int k = int.Parse(ss[1]);
            int l = int.Parse(ss[2]);
            int c = int.Parse(ss[3]);
            int d = int.Parse(ss[4]);
            int p = int.Parse(ss[5]);
            int nl = int.Parse(ss[6]);
            int np = int.Parse(ss[7]);
            int min = int.MaxValue;
            min = Math.Min(min, (k * l) / (n * nl));
            min = Math.Min(min, (c * d) / n);
            min = Math.Min(min, p / (n * np));
            Console.WriteLine(min);
        }
    }
}

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

namespace broze
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int f = (n[1] * n[2]) / n[6];
            int s = n[3] * n[4];
            int t = n[5]/n[7];
            int v = Math.Min(f, s);
            Console.WriteLine(Math.Min(v,t)/n[0]);
        }
    }
}

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

namespace ConsoleApplication30
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int n = 0;
            int k = 0;
            int l = 0;
            int c = 0;
            int d = 0;
            int p = 0;
            int nl = 0;
            int np = 0;
            int counter = 0;
            string temp = "";
            for (int i = 0; i < s.Length; i++)
            {
                if (i == s.Length - 1)
                    np = int.Parse(temp + s[i]);
                else if (s[i] != ' ')
                    temp += s[i];
                else if (s[i] == ' ')
                {
                    int x = int.Parse(temp);
                    if (counter == 0)
                    { n = x; counter++; }
                    else if (counter == 1)
                    { k = x; counter++; }
                    else if (counter == 2)
                    { l = x; counter++; }
                    else if (counter == 3)
                    { c = x; counter++; }
                    else if (counter == 4)
                    { d = x; counter++; }
                    else if (counter == 5)
                    { p = x; counter++; }
                    else if (counter == 6)
                    { nl = x; counter++; }
                    temp = "";
                }
            }
            int overallDrink = k * l;
            int overallDrinkIsEnoughForToasts = overallDrink / nl;
            int limesEnoughForToasts = c * d;
            int saltEnoughForToasts = p / np;
            int min;
            if (overallDrinkIsEnoughForToasts <= limesEnoughForToasts && overallDrinkIsEnoughForToasts <= saltEnoughForToasts)
                min = overallDrinkIsEnoughForToasts;
            else if (limesEnoughForToasts <= overallDrinkIsEnoughForToasts && limesEnoughForToasts <= saltEnoughForToasts)
                min = limesEnoughForToasts;
            else
                min = saltEnoughForToasts;
            Console.WriteLine(min / n);
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;

namespace prA {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter("output");
        private static readonly StreamReader reader = new StreamReader("input");
#endif
        static void Main(string[] args) {
            int n = Next();
            int k = Next();
            int l = Next();
            int c = Next();
            int d = Next();
            int p = Next();
            int nl = Next();
            int np = Next();
            int ans = Math.Min(k * l / nl, Math.Min(c * d, p / np)) / n;
            writer.WriteLine(ans);
            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

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

namespace ConsoleApplication252
{
    class Program
    {
        static void Main()
        {
            string[] ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            int k = int.Parse(ss[1]);
            int l = int.Parse(ss[2]);
            int c = int.Parse(ss[3]);
            int d = int.Parse(ss[4]);
            int p = int.Parse(ss[5]);
            int nl = int.Parse(ss[6]);
            int np = int.Parse(ss[7]);
            int kolBut = k * l /nl/ n;
            int kolLime = c * d / n;
            int kolSol = p / np / n;
            int[] m = { kolBut, kolLime, kolSol };
            Array.Sort(m);
            Console.WriteLine(m[0]);
        }
    }
}

using System;
using System.Linq;

namespace tren
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] mass = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int cola = (mass[1] * mass[2]) / mass[6];
            int lime = mass[3] * mass[4];
            int salt = (mass[5] / mass[7]);
            int min = Math.Min(cola, lime);
            Console.Write(Math.Min(min, salt) / mass[0]);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ASM
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] line = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray<int>();

            int friends = line[0];
            int bottles = line[1];
            int milliliters = line[2];
            int limes = line[3];
            int slices = line[4];
            int salt = line[5];
            int wantedLiters = line[6];
            int wantedSalt = line[7];

            int a = ((bottles * milliliters)/wantedLiters)/friends; //All milliliters
            int b = (limes * slices)/friends;
            int c = (salt / wantedSalt)/friends;

            Console.WriteLine(Math.Min(a, Math.Min(b, c)));
        }
    }
}

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

namespace fun
{
    class Program
    {
        private static TextReader cin = Console.In;
        private static TextWriter cout = Console.Out;
        static void Main(string[] args)
        {
            string s = cin.ReadLine() ;
            int n = int.Parse(s.Split(' ')[0]);
            int k = int.Parse(s.Split(' ')[1]);
            int l = int.Parse(s.Split(' ')[2]);
            int c = int.Parse(s.Split(' ')[3]);
            int d = int.Parse(s.Split(' ')[4]);
            int p = int.Parse(s.Split(' ')[5]);
            int nl = int.Parse(s.Split(' ')[6]);
            int np = int.Parse(s.Split(' ')[7]);
            cout.WriteLine(Math.Min(Math.Min(c * d, k * l / nl), p / np) / n);

        }
    }
}

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

namespace ConsoleApplication1
{
    public class Program
    {
        public static void Main()
        {
            int[] parameters;
            int[] ingredients = new int[3];//handles milimeters, limes, and salt variables

            parameters = Console.ReadLine().Split(' ').Select(n => Convert.ToInt32(n)).ToArray();

            ingredients[0] = parameters[1] * parameters[2];//quantity of drink available for toasts
            ingredients[0] /= parameters[6];

            ingredients[1] = parameters[3] * parameters[4];//limes available for toasts

            ingredients[2] = parameters[5] / parameters[7];//salt available for toasts

            Array.Sort(ingredients);

            Console.WriteLine(Math.Min(ingredients[0], ingredients[1]) / parameters[0]);
        }
    }
}

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

using System;

namespace AllProblems
{
    class Program
    {
        static void Main(string[] args)
        {
            _151A_SoftDrinking.Run();

        }
    }
    class _151A_SoftDrinking
    {
        public static void Run()
        {
            var ln = Console.ReadLine().Trim().Split(' ');
            var a = new short[8];
            for (short i = 0; i < 8; i++)
                a[i] = short.Parse(ln[i]);

            var d = a[1]*a[2];
            var l = a[3]*a[4];

            var min = Math.Min(d/a[6], Math.Min(l, a[5]/a[7])) / a[0];
            Console.WriteLine(min);
            Console.ReadLine();
        }
    }
}

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

namespace Codeforces
{
    class Program {

        #region input

        static long readLong() {
            long num;
            long.TryParse(Console.ReadLine(),out num);
            return num;
        }

        static ulong readULong() {
            ulong num;
            ulong.TryParse(Console.ReadLine(),out num);
            return num;
        }

        static int readInt() {
            int num;
            int.TryParse(Console.ReadLine(),out num);
            return num;
        }

        static bool readBool() {
            int num;
            int.TryParse(Console.ReadLine(),out num);
            return num != 0;
        }

        static long[] readLongs() {
            string[] nums = Console.ReadLine().Split(new char[] { ' ' });
            long[] parsed = new long[nums.Length];
            for(int i = 0; i < nums.Length; i++) {
                long.TryParse(nums[i],out parsed[i]);
            }
            return parsed;
        }

        static int[] readInts() {
            string[] nums = Console.ReadLine().Split(new char[] { ' ' });
            int[] parsed = new int[nums.Length];
            for(int i = 0; i < nums.Length; i++) {
                int.TryParse(nums[i],out parsed[i]);
            }
            return parsed;
        }

        static void readInts(out int a,out int b) {
            string[] nums = Console.ReadLine().Split(new char[] { ' ' });
            int[] parsed = new int[nums.Length];
            int.TryParse(nums[0],out a);
            int.TryParse(nums[1],out b);
        }

        static BitArray readBools() {
            string[] nums = Console.ReadLine().Split(new char[] { ' ' });
            BitArray bits = new BitArray(nums.Length);
            for(int i = 0; i < nums.Length; i++) {
                if(nums[i] != "0") {
                    bits[i] = true;
                }
            }
            return bits;
        }

        static BitArray readBools(string off) {
            string[] nums = Console.ReadLine().Split(new char[] { ' ' });
            BitArray bits = new BitArray(nums.Length);
            for(int i = 0; i < nums.Length; i++) {
                if(nums[i] != off) {
                    bits[i] = true;
                }
            }
            return bits;
        }

        static void waist() {
            Console.ReadLine();
        }

        #endregion

        #region utility

        static void print(List<int> l) {
            for(int i = 0; i < l.Count; i++) {
                if(i != 0) {
                    Console.Write(" ");
                }
                Console.Write((l[i]));
            }
            Console.WriteLine();
        }

        static long largeModolu(long a,long b,long m) {
            long prev = a;
            long sum = (b & 1) > 0 ? a : 1;
            int digits = (int)(Math.Ceiling(Math.Log(b,2)));
            for(int i = 1; i < digits; i++) {
                prev = (prev * prev) % (m);
                if((b & (1l << i)) > 0) {
                    sum = (sum * prev) % (m);
                }
            }
            return sum;
        }

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

        class SortableKVP<T> where T : IComparable {
            List<Tuple<int,T>> data { set; get; }

            public int count {
                get {
                    return data.Count;
                }
            }

            public T this[int index] {
                get {
                    return data[index].Item2;
                }
            }

            public int originalIndex(int sortedIndex) {
                return data[sortedIndex].Item1;
            }

            public void sort() {
                data.Sort((a,b) => a.Item2.CompareTo(b.Item2));
            }

            public void add(T item) {
                data.Add(new Tuple<int,T>(data.Count,item));
            }

            public void removeAt(int sortedIndex) {
                data.RemoveAt(sortedIndex);
            }

            public SortableKVP() {
                data = new List<Tuple<int,T>>();
            }

            public SortableKVP(T[] data) {
                this.data = new List<Tuple<int,T>>(data.Length);
                for(int i = 0; i < data.Length; i++) {
                    this.data.Add(new Tuple<int,T>(i,data[i]));
                }
            }
        }

        #endregion

        static void Main(string[] args) {
            long[] input = readLongs();
            Console.WriteLine(Math.Min(Math.Min(input[1] * input[2] / input[6],input[3] * input[4]),input[5] / input[7]) / input[0]);
        }
    }
}

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

namespace CF._151A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int n = int.Parse(input[0]);
            int k = int.Parse(input[1]);
            int l = int.Parse(input[2]);
            int c = int.Parse(input[3]);
            int d = int.Parse(input[4]);
            int p = int.Parse(input[5]);
            int nl = int.Parse(input[6]);
            int np = int.Parse(input[7]);
            int drinkHas = k * l;
            int sliceHas = c * d;
            int drinkNeed = n * nl;
            int sliceNeed = n;
            int saltNeed = n * np;
            int ans = Math.Min(drinkHas / drinkNeed, Math.Min(sliceHas / sliceNeed, p / saltNeed));
            Console.WriteLine(ans.ToString());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;

namespace codeforces
{
	class Program
	{
		public class User
		{
			public int c;

			public int r;
		}

		public class Comparer : IComparer<User>
		{
			public int Compare(User x, User y)
			{
				if (x.c < y.c)
					return -1;
				return 1;
			}
		}

		public static long getGcd(long a, long b)
		{
			if (b == 0)
				return a;
			return getGcd(b, a % b);
		}

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

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

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

		public static int Min(int x, int y)
		{
			return Math.Min(x, y);
		}

		public static int Max(int x, int y)
		{
			return Math.Max(x, y);
		}

		public static int Abs(int x)
		{
			return Math.Abs(x);
		}

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

		public static bool Equal(int x, int y, int x1, int y1)
		{
			return x == x1 && y == y1;
		}

		public class Vertex
		{
			public List<int> edges;

			public int ct;

			public Vertex()
			{
				ct = 0;
				edges = new List<int>();
				for (var i = 0; i < 26; ++i)
					edges.Add(0);
			}
		}

		private static void Main(string[] args)
		{
/*			var input = new StreamReader("input.txt");
			var output = new StreamWriter("output.txt");*/
			var l = getList();
			var ans = Min(Min(l[1] * l[2] / l[6], l[5] / l[7]), l[3] * l[4]) / l[0];
			Console.WriteLine(ans);
			/*			input.Close();
			output.Close();*/
		}
	}
}

using System;
using System.Linq;

namespace _151A
{
    class Program
    {
        static void Main()
        {
            var s = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var ans = Math.Min( (s[1] * s[2] / s[6]), Math.Min(s[5]/s[7], s[3]*s[4]))/s[0];
            Console.WriteLine(ans);
        }
    }
}

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

namespace MakeCalendar
{
    class MainClass
    {

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

        static void ReadInt(ref int a)
        {
            a = ReadIntArrayLine()[0];
        }

        static void ReadInts(ref int a, ref int b)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1];
        }

        static void ReadInts(ref int a, ref int b, ref int c)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2];
        }

        static void ReadInts(ref int a, ref int b, ref int c, ref int d)
        {
            var x = ReadIntArrayLine();
            a = x[0]; b = x[1]; c = x[2]; d = x[3];
        }

        static int[] ReadIntArrayLine()
        {
            char[] sep = { ' ' };
            return Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        static void PrintLn(object obj)
        {
            Console.WriteLine(obj.ToString());
        }

        public static string Reverse(string s)
        {
            char[] charArray = s.ToCharArray();
            Array.Reverse(charArray);
            return new string(charArray);
        }

        public static void PrintLnCollection<T>(IEnumerable<T> col)
        {
            PrintLn(string.Join(" ",col));
        }

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

//----------------------------------------------------------------------------

        static void Main(string[] args)
        {
            int[] a = ReadIntArrayLine();

            int n=a[0], k=a[1], l=a[2], c=a[3], d=a[4], p=a[5], nl=a[6], np=a[7];

            int pd = (k * l) / nl;
            int pl = c * d;
            int ps = p / np;

            PrintLn(Math.Min(pd, Math.Min(pl, ps))/n);

        }

    }
}

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

namespace ConsoleApp2
{
	class Program
	{
		static void Main(string[] args)
		{
			var number = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
			var friends = number[0];
			var bottles = number[1];
			var milliliters = number[2];
			var limes = number[3];
			var slices = number[4];
			var salt = number[5];
			var nl = number[6];
			var np = number[7];

			var totalDrink = bottles * milliliters;
			var toasts = totalDrink / friends;
			var toastsWithLimes = limes * slices;
			var toastsWithSalt = salt / np;

			Console.WriteLine(Math.Min(toasts, Math.Min(toastsWithLimes, toastsWithSalt)) / nl);
		}
	}
}

using System;

namespace ConsoleApp2
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int[] arr = new int[10];
            int size = 0;

            foreach(var tmp in Console.ReadLine().Split())
            {
                arr[size] = Convert.ToInt32(tmp);
                size++;
            }

            int n = arr[0];

            int remaining_vodka = arr[1] * arr[2];
            int remaining_limes = arr[3] * arr[4];
            int remaining_salt = arr[5];
            int vodka_for_one_tost = arr[6];
            int salt_for_one_tost = arr[7];

            int counter = 0;

            while(remaining_vodka >= n * vodka_for_one_tost && remaining_salt >= n * salt_for_one_tost && remaining_limes >= 1)
            {
                remaining_vodka -= n * vodka_for_one_tost;
                remaining_salt -= n * salt_for_one_tost;
                remaining_limes--;
                counter++;
            }
            Console.WriteLine(counter);

        }
    }
}

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

namespace CSharp_Shell
{

    public static class Program
    {
        public static void Main()
        {
          int[] inputs = "10 1000 1000 25 23 1 50 1".Split(' ').Select<string,int>(int.Parse).ToArray();
          int n = inputs[0];
          int k = inputs[1];
          int l = inputs[2];
          int c = inputs[3];
          int d = inputs[4];
          int p = inputs[5];
          int nl = inputs[6];
          int np = inputs[7];
          int k1 = (k*l)/nl;
          int k2 = (c*d);
          int k3 = p/np;
          int min = Math.Min(Math.Min(k1,k2),k3);
          Console.WriteLine(min/n);
        }
    }
}

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

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

            string[] chysla = Console.ReadLine().Split(' ');
            int n = Int32.Parse(chysla[0]), k = Int32.Parse(chysla[1]), l = Int32.Parse(chysla[2]), c = Int32.Parse(chysla[3]), d = Int32.Parse(chysla[4]),
                p = Int32.Parse(chysla[5]), nl = Int32.Parse(chysla[6]), np = Int32.Parse(chysla[7]);
            int[] tosty = new int[3];
            tosty[0] = k * l/n;
            tosty[1] = c * d;
            tosty[2] = p / np;
            int k_tostiv = tosty.Min() / n;
            Console.WriteLine(k_tostiv);

        }
    }
}

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

namespace Hasirovka
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            string[] chysla = new string[8];
            chysla= str.Split(' ');
            int n, k, l, c, d, p, nl, np;
            n = Int32.Parse(chysla[0]);
            k = Int32.Parse(chysla[1]);
            l=Int32.Parse(chysla[2]);
            c=Int32.Parse(chysla[3]);
            d=Int32.Parse(chysla[4]);
            p=Int32.Parse(chysla[5]);
            nl=Int32.Parse(chysla[6]);
            np = Int32.Parse(chysla[7]);
            int[] tosty = new int[3];
            tosty[0] = k * l/n;
            tosty[1] = c * d;
            tosty[2] = p / np;
            int k_tostiv = tosty.Min() / n;
            Console.WriteLine(k_tostiv);

        }
    }
}

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

namespace CodeForcesProblems.A
{
    class A115_Party
    {
        public static void Main()
        {
            //while(true)
            //{
                int n, k, l, c, d, p, nl, np;
                string[] a = Console.ReadLine().Split(' ');
                n = int.Parse(a[0]);
                k = int.Parse(a[1]);
                l = int.Parse(a[2]);
                c = int.Parse(a[3]);
                d = int.Parse(a[4]);
                p = int.Parse(a[5]);
                nl = int.Parse(a[6]);
                np = int.Parse(a[7]);
                var totalMl = k * l;
                var totalLime = c * d;
                nl *= n;
                np *= n;
                int toasts = 0;
                while(nl<totalMl && np<p && n<totalLime)
                {
                    toasts++;

                    totalMl -= nl;
                    totalLime -= n;
                    p -= np;
                }
                Console.WriteLine(toasts);
           // }
        }
    }
}

using System;

namespace ConsoleApp27
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int n = int.Parse(s.Split(' ')[0]), k = int.Parse(s.Split(' ')[1]), l = int.Parse(s.Split(' ')[2]),
                c = int.Parse(s.Split(' ')[3]), d = int.Parse(s.Split(' ')[4]), p = int.Parse(s.Split(' ')[5]),
                nl = int.Parse(s.Split(' ')[6]), np = int.Parse(s.Split(' ')[7]);
            int tostb = k * l / nl / n;
            int tosts = p / np / n;
            int tostd = d / n;
            Console.WriteLine(Math.Min(Math.Min(tostb, tosts), Math.Min(tosts, tostd)));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            string s;

            s = Console.ReadLine();
            string[] b = s.Split(' ');
            int[] numbers=new int[8];

           // numbers[1] = int.Parse(b[1]);
            for (int i = 0; i < b.Length; i++)
            {
               numbers[i] = int.Parse(b[i]);
             //   Console.WriteLine(numbers[i]);
            }
            int x, y, z;
            x = (numbers[1] * numbers[2]) / numbers[6];
            y = numbers[3] * numbers[4];
            z = numbers[5] * numbers[7];
            int min = x;
            if (y < min)
            {
                if (z < min)
                    min = z;
                else
                    min = y;
            }
            int res = min / numbers[0];
            Console.Write(res);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            string s;

            s = Console.ReadLine();
            string[] b = s.Split(' ');
            int[] numbers=new int[8];

           // numbers[1] = int.Parse(b[1]);
            for (int i = 0; i < b.Length; i++)
            {
               numbers[i] = int.Parse(b[i]);
             //   Console.WriteLine(numbers[i]);
            }
            int x, y, z;
            x = (numbers[1] * numbers[2]) / numbers[6];
            y = numbers[3] * numbers[4];
            z = numbers[5] / numbers[7];
            int min = x;
            if (y < min)
            {
                if (z < min)
                    min = z;
                else
                    min = y;
            }
            int res = min / numbers[0];
            Console.Write(res);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int k= Convert.ToInt32(s[1]);
            int l= Convert.ToInt32(s[2]);
            int c = Convert.ToInt32(s[3]);
            int d = Convert.ToInt32(s[4]);
            int p = Convert.ToInt32(s[5]);
            int nl = Convert.ToInt32(s[6]);
            int np = Convert.ToInt32(s[7]);
            int[] a = new int[3];
            int gas = k * l;
            int g = gas / n; a[0] = g;
            int lai = c * d; a[1] = lai;
            int soli = p / np; a[2] = soli;
            int min = 100000000;
            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] < min) { min = a[i]; }
            }
            Console.WriteLine(min / n);

        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int k= Convert.ToInt32(s[1]);
            int l= Convert.ToInt32(s[2]);
            int c = Convert.ToInt32(s[3]);
            int d = Convert.ToInt32(s[4]);
            int p = Convert.ToInt32(s[5]);
            int nl = Convert.ToInt32(s[6]);
            int np = Convert.ToInt32(s[7]);
            int[] a = new int[3];
            int gas = k * l;
            int g = gas / n; a[0] = g;
            int lai = c * d; a[1] = lai;
            int soli = p / np; a[2] = soli;
            int min = 100000000;
            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] < min) { min = a[i]; }
            }
            Console.WriteLine(min / nl);

        }
    }
}

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

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

                string input;
                input = Console.ReadLine();
                string[] split = input.Split(' ');
                int []Constraint=new int[split.Length];
                for (int i = 0; i < split.Length; i++)
                {
                    Constraint[i] = Convert.ToInt32( split[i]);
                }

                int mmOfdrinks = Constraint[1] * Constraint[2];
                int numberOFtoasts = mmOfdrinks / Constraint[0];
                int limes = Constraint[3] * Constraint[4];
                int salt = Constraint[5] * Constraint[7];
                List<int> iList = new List<int>();
                iList.Add(numberOFtoasts);
                iList.Add(limes);
                iList.Add(salt);
                int min = iList.Min();
                min /= Constraint[0];
                Console.WriteLine(min.ToString());

            }

        }
    }

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

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

                string input;
                input = Console.ReadLine();
                string[] split = input.Split(' ');
                int []Constraint=new int[split.Length];
                for (int i = 0; i < split.Length; i++)
                {
                    Constraint[i] = Convert.ToInt32( split[i]);
                }

                int mmOfdrinks = Constraint[1] * Constraint[2];
                int numberOFtoasts = mmOfdrinks / Constraint[0];
                int limes = Constraint[3] * Constraint[4];
                int salt = Constraint[5] / Constraint[7];
                List<int> iList = new List<int>();
                iList.Add(numberOFtoasts);
                iList.Add(limes);
                iList.Add(salt);
                int min = iList.Min();
                min /= Constraint[0];
                Console.WriteLine(min.ToString());

            }

        }
    }

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

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);
            int n = a[0], k = a[1], l = a[2], c = a[3], d = a[4], p = a[5], nl = a[6], np = a[7];
            Console.WriteLine(Math.Min(k * l / nl, Math.Min(c * d, p / np)));
        }
    }
}

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

namespace ConsoleApp5
{
    public class Program
    {
        static void Main()
        {
            var s = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var res = Min(s[1] * s[2] / s[0], s[3] * s[4], s[5] / s[7]) / s[0];
            Console.WriteLine(res);
        }
        static int Min(int a, int b, int c)
        {
            return Math.Min(Math.Min(a, b), c);
        }
    }
}

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

namespace A.Газировкопитие
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int k = Convert.ToInt32(s[1]);
            int l = Convert.ToInt32(s[2]);
            int c = Convert.ToInt32(s[3]);
            int d = Convert.ToInt32(s[4]);
            int p = Convert.ToInt32(s[5]);
            int nl = Convert.ToInt32(s[6]);
            int np = Convert.ToInt32(s[7]);
            int gaz = (k * l) / nl;
            int lime = c * d;
            int salt = p / np;
        }

        static void Tosti(int gaz, int lime, int salt, int chelov)
        {
            int min1=99999999;
            int[] min = new int[3];
            min[0]= gaz/chelov;
            min[1] = lime / chelov;
            min[2] = salt / chelov;
            for (int i = 0; i < 4; i++)
                if (min[i] < min1)
                    min1 = min[i];
            Console.WriteLine(min1);
        }

    }
}

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

namespace A.Газировкопитие
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(s[0]);
            int k = Convert.ToInt32(s[1]);
            int l = Convert.ToInt32(s[2]);
            int c = Convert.ToInt32(s[3]);
            int d = Convert.ToInt32(s[4]);
            int p = Convert.ToInt32(s[5]);
            int nl = Convert.ToInt32(s[6]);
            int np = Convert.ToInt32(s[7]);
            int gaz = (k * l) / nl;
            int lime = c * d;
            int salt = p / np;
            Tosti(gaz,lime,salt,n);
        }

        static void Tosti(int gaz, int lime, int salt, int chelov)
        {
            int min1=100;
            int[] min = new int[3];
            min[0] = gaz;
            min[1] = lime;
            min[2] = salt;
            for (int i = 0; i < 3; i++)
                if (min[i] < min1)
                    min1 = min[i];
            Console.WriteLine(min1/chelov);
        }

    }
}

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

class Program
{
    //2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
    static void Main(string[] args)
    {

        string input = Console.ReadLine();

        string[] results = input.Split(' ');

        List<int> num = new List<int>();

        foreach( var r in results)
        {
            num.Add(Convert.ToInt32(r));
        }

        int value1 = num[6] * num[2] / num[0];
        int value2 = num[3] * num[4];
        int value3 = num[5] / num[7];

        Console.WriteLine(Math.Min(Math.Min(value1, value2), value3) / num[1]);

    }
}

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

class Program
{
    //2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
    static void Main(string[] args)
    {

        string input = Console.ReadLine();

        string[] results = input.Split(' ');

        List<int> num = new List<int>();

        foreach( var r in results)
        {
            num.Add(Convert.ToInt32(r));
        }

        int value1 = num[1] * num[2] / num[0];
        int value2 = num[3] * num[4];
        int value3 = num[5] / num[6];

        Console.WriteLine(Math.Min(Math.Min(value1, value2), value3) / num[6]);

    }
}

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

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

            int n, k, l, c, d, p, nl, np;
            var line = Console.ReadLine();
            var num = line.Split(' ');
            n = int.Parse(num[0]);
            k= int.Parse(num[1]);
            l= int.Parse(num[2]);
            c= int.Parse(num[3]);
            d= int.Parse(num[4]);
            p= int.Parse(num[5]);
           nl= int.Parse(num[6]);
           np= int.Parse(num[7]);

            int v1 = (k * l) / n;
            int v2 = c * d;
            int v3 = (p / nl);
            int[] arr = { v1, v2, v3 };
            int ans = (arr.Min()) / n;
            Console.WriteLine(ans);
        }
    }
}

using System;
class MyBuild
{
    static void Main()
    {
        string input = Console.ReadLine();
        string[] strnum = input.Split(' ');
        int[] numsin = Array.ConvertAll(strnum, int.Parse);

        int milliliters = numsin[1] * numsin[2];
        int totalslices = numsin[3] * numsin[4];
        int salt = numsin[5];

        int toastchecker = 3;
        int toastcounter = -1;

        while (toastchecker ==3)
        {
            toastchecker = 0;

            milliliters -= numsin[0] * numsin[6];
            totalslices -= numsin[0];
            salt -= numsin[0] * numsin[7];

            if (milliliters >= 0)
            {
                toastchecker++;
            }
            if (totalslices > 0)
            {
                toastchecker++;
            }
            if (salt > 0)
            {
                toastchecker++;
            }

            toastcounter++;
        }

        Console.WriteLine(toastcounter);

    }
}

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

namespace _318A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] fline = Console.ReadLine().Split(' ');
            int y = 1,z=2;
            int[] x = new int[int.Parse(fline[0])];

            for (int i = 1; i <= x.Length; i++)
            {
                    if (i <= x.Length / 2)
                    {
                        x[i - 1] = y;
                        y += 2;
                    }
                else
                {
                    x[i - 1] = z;
                    z += 2;
                }
            }
            if (x.Length%2!=0&& int.Parse(fline[1]) > 1)
            {
                Console.WriteLine(x[int.Parse(fline[1]) - 2]);
            }
            else
            {
                Console.WriteLine(x[int.Parse(fline[1]) - 1]);
            }

        }
    }
}

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

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

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

using System;
using System.Linq;

namespace _151A
{
    class Program
    {
        static void Main()
        {
            var s = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var ans = Math.Min( (s[1] * s[2] / s[6]), Math.Min(s[5], s[3]*s[4]))/s[0];
            Console.WriteLine(ans);
        }
    }
}