«One dragon. Two dragon. Three dragon», — the princess was counting. She had trouble falling asleep, and she got bored of counting lambs when she was nine.However, just counting dragons was boring as well, so she entertained herself at best she could. Tonight she imagined that all dragons were here to steal her, and she was fighting them off. Every k-th dragon got punched in the face with a frying pan. Every l-th dragon got his tail shut into the balcony door. Every m-th dragon got his paws trampled with sharp heels. Finally, she threatened every n-th dragon to call her mom, and he withdrew in panic.How many imaginary dragons suffered moral or physical damage tonight, if the princess counted a total of d dragons?

Input data contains integer numbers k, l, m, n and d, each number in a separate line (1 ≤ k, l, m, n ≤ 10, 1 ≤ d ≤ 105).

NoteIn the first case every first dragon got punched with a frying pan. Some of the dragons suffered from other reasons as well, but the pan alone would be enough.In the second case dragons 1, 7, 11, 13, 17, 19 and 23 escaped unharmed.

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

namespace test
{
    class Program
    {

        static void Main(string[] args)
        {
            string numberk = Console.ReadLine();
//             string[] splitchar = new string[] { " " };
            Int32 k = Convert.ToInt32(numberk);

            string numberl = Console.ReadLine();
            Int32 l = Convert.ToInt32(numberl);

            string numberm = Console.ReadLine();
            Int32 m = Convert.ToInt32(numberm);

            string numbern = Console.ReadLine();
            Int32 n = Convert.ToInt32(numbern);

            string numberd = Console.ReadLine();
            Int32 d = Convert.ToInt32(numberd);

            List<int> hehe = new List<int>();
            for (int i = 0; i < d; i++)
            {
                hehe.Add(i + 1);
            }
            int sum = 0;
            for (int j = 0; j < d; j++)
            {
                if (hehe[j] % k == 0 || hehe[j] % l == 0 || hehe[j] % m == 0 || hehe[j] % n == 0)
                {
                    sum++;
                }
            }
            Console.WriteLine(sum);

        }
    }
}

using System;

namespace A
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int k, l, m, n, d;
            int count = 0;
            k = Convert.ToInt32(Console.ReadLine());
            l = Convert.ToInt32(Console.ReadLine());
            m = Convert.ToInt32(Console.ReadLine());
            n = Convert.ToInt32(Console.ReadLine());
            d = Convert.ToInt32(Console.ReadLine());
            int[] arr = new int[d];
            for (int i = 0; i < d; i++)
            {
                arr[i] = i + 1;
                if (arr[i] % k == 0 || arr[i] % l == 0 || arr[i] % m == 0 || arr[i] % n == 0)
                    count++;
            }

            Console.Write(count);

        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var del = new int[4];
            del[0] = int.Parse(Console.ReadLine());
            del[1] = int.Parse(Console.ReadLine());
            del[2] = int.Parse(Console.ReadLine());
            del[3] = int.Parse(Console.ReadLine());
            var d = int.Parse(Console.ReadLine());
            var res = 0;
            for (int i = 1; i <= d; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (i%del[j] == 0)
                    {
                        res++;
                        break;
                    }
                }
            }

            Console.WriteLine(res);
        }
    }
}

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

namespace InsomniaCure
{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList input = new ArrayList();

            for (int i = 0; i < 5; i++)
                input.Add(int.Parse(Console.ReadLine()));

                int dragonsAlive = 0;
                for (int i = 1; i <=(int) input[input.Count-1]; i++)
                {
                for (int j = 0; j < input.Count-1; j++)
                    if (i % (int)input[j] == 0)
                    {
                        dragonsAlive++;
                        break;
                    }
                }
                Console.WriteLine(dragonsAlive);
                Console.ReadLine();

        }
    }
}

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

namespace ConsoleApplication2
{
    class Program
    {

        static void Main()
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            bool[] dr = new bool[d];
            int count = 0;

            if (k == 1 || l == 1 || m == 1 || n == 1)
                Console.WriteLine(d);
            else
            {
                for (int i = k; i <= d; i = i + k)
                    dr[i-1] = true;

                for (int i = l; i <= d; i = i + l)
                    dr[i-1] = true;

                for (int i = m; i <= d; i = i + m)
                    dr[i-1] = true;

                for (int i = n; i <= d; i = i + n)
                    dr[i-1] = true;

                for (int i = 0; i < d; i++)
                {
                    if (dr[i] == true)
                        count++;
                }

                Console.WriteLine(count);
            }

        }
    }
}

using System;
using System.Linq;

class Program {
  static void Main() {
    var divs = Enumerable.Range(0, 4)
                         .Select(i => int.Parse(Console.ReadLine()))
                         .ToArray();
    var d = int.Parse(Console.ReadLine());
    var n = Enumerable.Range(1, d).Count(x => divs.Any(div => x % div == 0));
    Console.WriteLine(n);
  }
}

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

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] Arr = new int[5];
            int res = 0;

            for (int i = 0; i < 5; i++)
                Arr[i] = Int32.Parse(Console.ReadLine());

            for (int i = 1; i <= Arr[4]; i++)
               if ((i % Arr[0] == 0) || (i % Arr[1] == 0) || (i % Arr[2] == 0) || (i % Arr[3] == 0))
                   res++;

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

 using System;
 class insumnia
 {
     static void Main()
     {
         int k = int.Parse(Console.ReadLine());
         int l = int.Parse(Console.ReadLine());
         int m = int.Parse(Console.ReadLine());
         int n = int.Parse(Console.ReadLine());
         int d = int.Parse(Console.ReadLine());
         int total = 0;

         for ( int i = 1; i <= d ; i++ )
         {
             if ( i%k != 0 && i%m != 0 && i%n !=0 && i%l !=0 )
             {
                 total+=0;
             }
             else
                 total++;
         }
         Console.WriteLine(total);

     }
 }

using System;

namespace Insomnia_Cure
{
    //Main Method
    class Program
    {
        static void Main(string[] args)
        {
            CountDragon drag = new CountDragon();

            drag.k = Convert.ToInt32(Console.ReadLine());
            drag.l = Convert.ToInt32(Console.ReadLine());
            drag.m = Convert.ToInt32(Console.ReadLine());
            drag.n = Convert.ToInt32(Console.ReadLine());
            drag.d = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine(drag.CountUnHearmed());
        }
    }

    //Interface
    interface IInsomnia
    {
        int CountUnHearmed();
    }

    //Main Functional Class
    class CountDragon:IInsomnia
    {
        public int k { get; set; }
        public int l { get; set; }
        public int m { get; set; }
        public int n { get; set; }
        public int d { get; set; }

        public int CountUnHearmed()
        {
            int count = 0;
            for (int i=1; i<=d; i++)
            {
                if (i % k == 0 || i % l ==0 || i % m == 0 || i % n == 0)
                {
                    count++;
                }
            }
            return count;
        }
    }
}

using System;

namespace myApp {
    class Program {
        static void Main (string[] args) {
            int[] a = new int[5];
            for(int i = 0; i < 5; i++)
                a[i] = int.Parse(Console.ReadLine());
            bool[] harmed = new bool[a[4]+1];
            int rs = 0;
            for(int i = 0; i < 4; i++){
                if(a[i] == 1){
                    rs = a[4]; break;
                    }
                for(int j = 1; j * a[i] <= a[4]; j++)
                    if(!harmed[j*a[i]]) {
                        harmed[j*a[i]] = true;
                        rs++;
                    }
            }
            Console.WriteLine(rs);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;

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

			public int r;

			public int pos;
		}

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

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

		private static void Main(string[] args)
		{
/*			var input = new StreamReader("input.txt");
			var output = new StreamWriter("output.txt");*/
			var s = Console.ReadLine();
			var k = int.Parse(s);
			s = Console.ReadLine();
			var l = int.Parse(s);
			s = Console.ReadLine();
			var m = int.Parse(s);
			s = Console.ReadLine();
			var n = int.Parse(s);
			s = Console.ReadLine();
			var d = int.Parse(s);
			var ans = 0;
			for (var i = 1; i <= d; ++i)
			{
				if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
					ans++;
			}
			Console.WriteLine(ans);
			/*			input.Close();
			output.Close();*/
		}
	}
}

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

namespace InsomniaCure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());

            int count = 0;

            for (int i = 1; i <= d; i++)
            {
                if ( (i % k == 0) ||
                     (i % l == 0) ||
                     (i % m == 0) ||
                     (i % n == 0) )
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = new int[100000];
            int b=1;
            int[] c = new int[100000];
            int[] n = new int[100];
            int num = 0;
            for (int i = 0; i < 5; i++){
                n[i] = int.Parse(Console.ReadLine());
                c[i] = n[i];
              }
            while (n[0]<=n[4])
            {
                a[n[0]-1] = 1;
                n[0] = n[0]+c[0];
            }
            while (n[1] <= n[4])
            {
                a[n[1]-1] = 1;
                n[1] = n[1] + c[1];
            }
            while (n[2] <= n[4])
            {
                a[n[2]-1] = 1;
                n[2] = n[2] + c[2];
            }
            while (n[3] <= n[4])
            {
                a[n[3]-1] = 1;
                n[3] = n[3] + c[3];
            }
            for(int k=0;k<n[4];k++)
                if (a[k] != 1)
                    num++;

            Console.WriteLine(n[4] - num);
            Console.ReadLine();

        }
    }
}

using System;

namespace _148A_Insomnia_cure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());
            int s = 0;
            if (k == 1 || l == 1 || m == 1 || n == 1)
                Console.WriteLine("{0}", d);
            else
            {
                for (int i = 2; i <= d; i++)
                {
                    if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    {
                        s++;
                    }

                }
                Console.WriteLine("{0}", s);
            }

        }
    }
}

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

namespace ConsoleApplication120
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, m, k, l;
            long d;
            k = int.Parse(Console.ReadLine());
            l = int.Parse(Console.ReadLine());
            m = int.Parse(Console.ReadLine());
            n = int.Parse(Console.ReadLine());
            d = long.Parse(Console.ReadLine());
            if (k == 1 || l == 1 || m == 1 || n == 1)
            {
                Console.WriteLine(d);
                return;
            }

            int c = 0;
            for (long i = 0; i < d; i++)
            {
                if ((i + 1) % k == 0 || (i + 1) % l == 0 || (i + 1) % m == 0 || (i + 1) % n == 0)
                {

                    c++;
                }
            }

            Console.WriteLine(c);

        }
    }
}

using System;
using System.Linq;

namespace A148
{
    class Program
    {
        static void Main(string[] args)
        {
            // Insomnia Cure
            int[] input = new int[5] { 0, 0, 0, 0, 0 };
            for (int i = 0; i < input.Length; i++)
                input[i] = int.Parse(Console.ReadLine()) ;

            int[] dragons = Enumerable.Range(1, input[4]).ToArray();
            int damaged = 0;

            for (int i = 0; i < dragons.Length; i++)
            {
                for (int e = 0; e < 4; e++)
                {
                    dragons[i] = dragons[i] % input[e] == 0 ? 0 : dragons[i];
                }
                damaged += dragons[i] == 0 ? 1 : 0;
            }
            Console.WriteLine(damaged);
        }
    }
}

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

namespace ConsoleApplication12
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int[] MyInt = new int[d + 1];
            int y = 0;

            for (int i = k; i <= d; i += k)
            {
                MyInt[i] = 1;
            }

            for (int i = l; i <= d; i += l)
            {
                MyInt[i] = 1;
            }

            for (int i = m; i <= d; i += m)
            {
                MyInt[i] = 1;
            }

            for (int i = n; i <= d; i += n)
            {
                MyInt[i] = 1;
            }
            int o = MyInt.Sum();
            Console.WriteLine(o);
        }
    }
}

using System;
using System.Collections.Generic;
namespace problems
{
    internal class _148A
    {
        private static void Main(string[] args)
        {
            var k = int.Parse(Console.ReadLine());
            var l = int.Parse(Console.ReadLine());
            var m = int.Parse(Console.ReadLine());
            var n = int.Parse(Console.ReadLine());
            var d = int.Parse(Console.ReadLine());
            int result=0;
            Calc(new[] { k, l, m, n }, 0, new List<int>(),d, ref result);

            //int result = d / k + d / l + d / m + d / n
            //             - d / lcm(k, m) - d / lcm(k, l) - d / lcm(k, n) - d / lcm(l, m) - d / lcm(n, m) - d / lcm(l, n)
            //             + d / lcm(k, l, n) + d / lcm(k,l, m) + d / lcm(m, l, n) + d / lcm(k, m, n)
            //    - d / lcm(k, l, m, n);
            Console.WriteLine(result);
        }

        private static void Calc(int[] array, int at, List<int> subset,int d, ref int result)
        {
            if (at == array.Length && subset.Count > 0)
            {
                result += d * ((subset.Count % 2 == 0) ? -1 : 1) / lcm(subset);
                return;
            }
            else if(at<array.Length)
            {
                Calc(array, at + 1, subset, d, ref result);
                subset.Add(array[at]);
                Calc(array, at + 1, subset, d, ref result);
                subset.RemoveAt(subset.Count - 1);
            }
        }

        private static int gcd(int a, int b)
        {
            while (b != 0)
            {
                var t = b;
                b = a % b;
                a = t;
            }
            return a;
        }

        private static int lcm(int a, int b)
        {
            return a * b / gcd(a, b);
        }

        private static int lcm(List<int> a)
        {
            var res = 1;
            foreach (int el in a)
            {
                res = lcm(res, el);
            }
            return res;
        }
    }
}

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

namespace Codeforces105
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int counter = 0;
            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0 || i % l == 0 || i % n == 0 || i % m == 0) counter++;
            }
            Console.WriteLine(counter);
            Console.ReadLine();
        }
    }
}

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

namespace CodeForces
{
    class _148A
    {
        public static void Main()
        {
            int k = Int32.Parse(Console.ReadLine());
            int l = Int32.Parse(Console.ReadLine());
            int m = Int32.Parse(Console.ReadLine());
            int n = Int32.Parse(Console.ReadLine());
            int totalDragons = Int32.Parse(Console.ReadLine());
            int damagedDragons = 0;
            for (int i = 1; i <= totalDragons; i++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                {
                    damagedDragons++;
                }
            }
            Console.WriteLine(damagedDragons);
        }
    }
}

//http://codeforces.com/problemset/problem/148/A
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CF_148A
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int[] dra = new int[d + 1];

            for (int i = k; i <= d; i += k)
                dra[i] = 1;
            for (int i = l; i <= d; i += l)
                dra[i] = 1;
            for (int i = m; i <= d; i += m)
                dra[i] = 1;
            for (int i = n; i <= d; i += n)
                dra[i] = 1;

            Console.WriteLine(dra.Sum());
        }
    }
}

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

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());
            int cnt = 0;
            for(int i = 1; i <= d; i++)
            {
                if(i%k==0 || i%l==0 || i%m==0 || i % n == 0)
                {
                    cnt += 1;
                }
            }
            Console.WriteLine(cnt);
            //Console.ReadKey();
        }
    }
}

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

namespace Codeforces__A.Слишком_длинные_слова_
{
    class RemedyForInsomnia
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int dragons=0;
            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    dragons++;
            }

            Console.WriteLine(dragons);
        }
    }
}

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

namespace CodeForces
{
    public class InsomniaCure
    {

#if Test
        private const bool isTesting = true;
#else
         private const bool isTesting = false;
#endif
        public static void Main ( string[] args )
        {
            if(!isTesting)
            {
                Run(Console.In);
                return;
            }
            RunTests();
        }
        public static void Run ( TextReader reader )
        {
            int[] mult = new int[4];
            mult[0] = int.Parse(reader.ReadLine());
            mult[1] = int.Parse(reader.ReadLine());
            mult[2] = int.Parse(reader.ReadLine());
            mult[3] = int.Parse(reader.ReadLine());
            int d = int.Parse(reader.ReadLine());
            bool[] damages = new bool[d + 1];
            for(int i = 0; i < mult.Length; i++)
            {
                int factor = mult[i];
                for(int num = factor; num <= d; num += factor)
                {
                    damages[num] = true;
                }
            }
            int count = 0;
            for(int i = 0; i < damages.Length; i++)
            {
                if(damages[i]) count++;
            }
            Console.WriteLine(count);
        }

        public static void RunTests ()
        {
            Run(new StringReader("1\n2\n3\n4\n12"));
            Run(new StringReader("2\n3\n4\n5\n24"));
        }
    }

}

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

namespace Fun
{
	class Program
	{
		static void Main(string[] args)
		{
			var k = int.Parse(Console.ReadLine());
			var l = int.Parse(Console.ReadLine());
			var m = int.Parse(Console.ReadLine());
			var n = int.Parse(Console.ReadLine());
			var d = int.Parse(Console.ReadLine());

			int c = 0;
			for (int i = 1; i <= d; i++)
			{
				if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
					c++;
			}
			Console.WriteLine(c);
		}
	}
}

using System;

namespace CodeforcesSolution
{
    public class InsomniaCure
    {
        public static void Main(string[] args)
        {
            int k, l, m, n, d;
            k = int.Parse(Console.ReadLine());
            l = int.Parse(Console.ReadLine());
            m = int.Parse(Console.ReadLine());
            n = int.Parse(Console.ReadLine());
            d = int.Parse(Console.ReadLine());
            if (k == 1 || l == 1 || m == 1 || n == 1)
            {
                Console.WriteLine(d);
                return;
            }
            int count = 0;
            for (int i = 1; i <= d; i++)
            {
                if ((i % k == 0) || (i % l == 0) || (i % m == 0) || (i % n == 0))
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
}

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

namespace ConsoleApplication39
{
    class Program
    {
        static int pointFlag(int k, int l, int m, int n, int[] drago)
        {
            for(int i= k-1; i<drago.Length; i = i+k)
            {
                drago[i] = 1;
            }

            for (int i = l-1; i < drago.Length; i = i + l)
            {
                drago[i] = 1;
            }

            for (int i = m-1; i < drago.Length; i = i + m)
            {
                drago[i] = 1;
            }

            for (int i = n -1; i < drago.Length; i = i + n)
            {
                drago[i] = 1;
            }

            return drago.Count(x=> x==1);
        }
        static void Main(string[] args)
        {
            //int[] mas = new int[3];
            //for (int i = 0; i < 3; i++ )
            //{
            //    mas[i] = int.Parse(Console.ReadLine());
            //}
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int[] drago = new int[d];

            Console.WriteLine(pointFlag(k, l, m, n, drago));

            //    double a = d/n;
            //if((d/mas.Min()+ Math.Ceiling(a))>d)
            //    Console.WriteLine(d);
            //else
            //    Console.WriteLine(d/mas.Min()+ Math.Ceiling(a));

        }
    }
}

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

namespace Codeforces98
{
	class A105
	{
		static void Main(string[] args)
		{
			int ans = 0;
			int k = int.Parse(Console.ReadLine());
			int l = int.Parse(Console.ReadLine());
			int m = int.Parse(Console.ReadLine());
			int n = int.Parse(Console.ReadLine());
			int d = int.Parse(Console.ReadLine());
			for (int i = 1; i <= d; i++)
			{
				if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
					ans++;
			}

				Console.WriteLine(ans);

	//			Console.ReadKey();
		}
	}
}

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

namespace InsomniaCure
{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList input = new ArrayList();

            for (int i = 0; i < 5; i++)
                input.Add(int.Parse(Console.ReadLine()));

                int dragonsAlive = 0;
                for (int i = 1; i <=(int) input[input.Count-1]; i++)
                {
                for (int j = 0; j < input.Count-1; j++)
                    if (i % (int)input[j] == 0)
                    {
                        dragonsAlive++;
                        break;
                    }
                }
                Console.WriteLine(dragonsAlive);
                Console.ReadLine();

        }
    }
}

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

namespace Competitive
{
    class Program
    {
        static void Main(string[] args)
        {
            var l = new List<int>();

            for (int i = 0; i < 4; i++)
            {
                l.Add(int.Parse(Console.ReadLine()));
            }

            var d = int.Parse(Console.ReadLine());

            var cnt = 0;

            for (int i = 1; i <= d; i++)
            {
                bool b = false;

                foreach(var x in l)
                {
                    b |= i % x == 0;
                }

                if (b)
                {
                    cnt++;
                }
            }

            Console.WriteLine(cnt);
        }
    }
}

#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

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

namespace _105d2a
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
#if DEBUG
        static bool _useFileInput = false;
#else
        static bool _useFileInput = false;
#endif

        static void Main(string[] args)
        {
            StreamWriter file = null;
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }

#if DEBUG
			if (!_useFileInput)
			{
				Console.SetIn(getInput());
			}
#endif

            try
            {
                solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }
        }

        static void solution()
        {
            #region SOLUTION
            var cs = new int[4];
            cs[0] = readInt();
            cs[1] = readInt();
            cs[2] = readInt();
            cs[3] = readInt();
            var d = readInt();

            var count = 0;
            for (int i = 1; i <= d; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (i % cs[j] == 0)
                    {
                        count++;
                        break;
                    }
                }
            }

            Console.WriteLine(count);
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

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

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

        static int[] readIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] readLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
		static StreamReader getInput()
		{
			var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
			var resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);

			return new StreamReader(resource);
		}
#endif
    }
}

namespace o
{
    using System;

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

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

namespace CF_Insomnia
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            List<int> all = new List<int>();
            for(int i=k;i<=d;i = i + k)
            {
                all.Add(i);
            }
            for (int i = l; i <= d; i = i + l)
            {
                all.Add(i);
            }
            for (int i = m; i <= d; i = i + m)
            {
                all.Add(i);
            }
            for (int i = n; i <= d; i = i + n)
            {
                all.Add(i);
            }
            all = all.Distinct().ToList();
            Console.WriteLine(all.Count());
        }
    }
}

using System;

namespace ConsoleApp1
{
    internal class Program
    {

        private static void Main(string[] args)
        {

            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int count = 0;
            for(int i=1;i<= d;i++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    count++;

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

        }

        // Console.ReadKey();

    }

}

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

namespace ConsoleApp5
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] data = new int[5];
            for(int i = 0; i < 5; i++)
                data[i] = Convert.ToInt32(Console.ReadLine());
            int result = data[4];
            for(int i = 1; i < data[4]+1; i++)
                if (i % data[0] != 0 && i % data[1] != 0 && i % data[2] != 0 && i % data[3] != 0) result--;
            Console.WriteLine(result);
        }
    }
}

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

namespace insomniaCure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m= Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());
            int count = 0;
            if (k==1 && l==1 && m==1 && n==1)
            {
                Console.WriteLine(d);
            }
            else
            {
                for (int i = 1; i <= d; i++)
                {
                    if ((i % k) != 0 && (i % l) != 0 && (i % m) != 0 && (i % n) != 0)
                    {
                        count++;
                    }
                }

                d = d - count;
                Console.WriteLine(d);
            }

            Console.ReadLine();
        }
    }
}

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

namespace ConsoleApp6
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int count = 0;
            for (int i = 1; i <= d; i++)
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    count++;
            Console.WriteLine(count);
        }
    }
}

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

namespace Средство_от_бессонницы
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int z = 0;
            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0)
                    z++;
                else if (i % l == 0)
                    z++;
                else if (i % m == 0)
                    z++;
                else if (i % n == 0)
                    z++;
            }
            Console.WriteLine(z);

        }
    }
}

using System;

namespace _148A
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());
            int result = 0;
            bool[] damageDragon = new bool[d];

            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0) damageDragon[i - 1] = true;
            }

            for (int i = 1; i <= d; i++)
            {
                if (i % l == 0) damageDragon[i - 1] = true;
            }

            for (int i = 1; i <= d; i++)
            {
                if (i % m == 0) damageDragon[i - 1] = true;
            }

            for (int i = 1; i <= d; i++)
            {
                if (i % n == 0) damageDragon[i - 1] = true;
            }

            for(int i = 0; i < d; i++)
            {
                if (damageDragon[i] == true) result++;
            }

            Console.WriteLine(result);
        }
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int sum = 0;
            int[] div = new int[4];
            div[0] = int.Parse(Console.ReadLine());
            div[1] = int.Parse(Console.ReadLine());
            div[2] = int.Parse(Console.ReadLine());
            div[3] = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            for (int i = 1; i <= n; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (i % div[j] == 0)
                    {
                        sum++;
                        break;
                    }

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

    }
}

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

public class Program
{
	public static void Main()
	{
		List<int> dr=new List<int>();
		int a=0;
		for(int i=0; i<5; i++)
		{
			dr.Add(int.Parse(Console.ReadLine()));
		}
		for(int i=1; i<=dr[4]; i++)
		{
			if(i%dr[0]==0 || i%dr[1]==0 || i%dr[2]==0 || i%dr[3]==0)
				a++;
		}

		Console.WriteLine(a);
	}

}

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

namespace ConsoleApplication12
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int[] MyInt = new int[d + 1];
            int y = 0;

            for (int i = k; i <= d; i += k)
            {
                MyInt[i] = 1;
            }

            for (int i = l; i <= d; i += l)
            {
                MyInt[i] = 1;
            }

            for (int i = m; i <= d; i += m)
            {
                MyInt[i] = 1;
            }

            for (int i = n; i <= d; i += n)
            {
                MyInt[i] = 1;
            }
            int o = MyInt.Sum();
            Console.WriteLine(o);
        }
    }
}

using System;

namespace codeforces
{
    class Program
    {

        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int dragons = int.Parse(Console.ReadLine());
            int count = 0;

            for (int i = 1; i <= dragons; i++)
                count += (i%k==0||i%l==0||i%m==0||i%n==0)?1:0;

            Console.WriteLine(count);

        }
    }
}

using System;
using System.Linq;

class Program {
  static void Main() {
    var divs = Enumerable.Range(0, 4)
                         .Select(i => int.Parse(Console.ReadLine()))
                         .ToArray();
    var d = int.Parse(Console.ReadLine());
    var n = Enumerable.Range(1, d).Count(x => divs.Any(div => x % div == 0));
    Console.WriteLine(n);
  }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var del = new int[4];
            del[0] = int.Parse(Console.ReadLine());
            del[1] = int.Parse(Console.ReadLine());
            del[2] = int.Parse(Console.ReadLine());
            del[3] = int.Parse(Console.ReadLine());
            var d = int.Parse(Console.ReadLine());
            var res = 0;
            for (int i = 1; i <= d; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (i%del[j] == 0)
                    {
                        res++;
                        break;
                    }
                }
            }

            Console.WriteLine(res);
        }
    }
}

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

namespace ConsoleApplication7
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt16(Console.ReadLine()),
                l = Convert.ToInt16(Console.ReadLine()),
                m = Convert.ToInt16(Console.ReadLine()),
                n = Convert.ToInt16(Console.ReadLine()),
                d = Convert.ToInt32(Console.ReadLine()),
                NotEscaped = 0;
            for (int i = 1; i <= d; i++)
            {
                if(i%k==0||i%l==0||i%m==0||i%n==0)
                {
                    NotEscaped++;
                }
            }
            Console.WriteLine(NotEscaped);
        }
    }
}

 using System;
 class insumnia
 {
     static void Main()
     {
         int k = int.Parse(Console.ReadLine());
         int l = int.Parse(Console.ReadLine());
         int m = int.Parse(Console.ReadLine());
         int n = int.Parse(Console.ReadLine());
         int d = int.Parse(Console.ReadLine());
         int total = 0;

         for ( int i = 1; i <= d ; i++ )
         {
             if ( i%k != 0 && i%m != 0 && i%n !=0 && i%l !=0 )
             {
                 total+=0;
             }
             else
                 total++;
         }
         Console.WriteLine(total);

     }
 }

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

namespace codeforces
{
    class Program
    {

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

            Console.WriteLine(count);
        }

    }
}

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

namespace ogaver__
{

    class Program
    {
        static void Main(string[] args)
        {
            var numbs = new List<int>();
            for (int i = 0; i < 4; i++)
                numbs.Add(Convert.ToInt32(Console.ReadLine()));

            var d = Convert.ToInt32(Console.ReadLine());

            //create dictionary to keep track of hits
            var tracker = new Dictionary<int, bool>();
            for (int i = 1; i <= d; i++)
                tracker.Add(i, false);

            foreach(int n in numbs)
            {
                if (tracker.All(v => v.Value))
                    break;

                Register(tracker, n, d);
            }

            int sum = 0;
            var list = tracker.Values;
            foreach (var value in list)
                if (value)
                    sum++;

            Console.WriteLine(sum);

        }

        static void Register(Dictionary<int, bool> register, int numb, int d)
        {
            for (int i = numb; i <= d; i += numb)
                register[i] = true;
        }

    }

}

using System;

namespace _148A_Insomnia_cure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());
            int s = 0;
            if (k == 1 || l == 1 || m == 1 || n == 1)
                Console.WriteLine("{0}", d);
            else
            {
                for (int i = 2; i <= d; i++)
                {
                    if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    {
                        s++;
                    }

                }
                Console.WriteLine("{0}", s);
            }

        }
    }
}

using System;
class Solution
{
    public static void Main()
    {
        int[] arr = new int[5]; int count = 0;
        for (int i = 0; i < 5; i++) arr[i] = Convert.ToInt32(Console.ReadLine());
        for (int j = 1; j <= arr[4]; j++)
        {
            if (j % arr[0] == 0 || j % arr[1] == 0 || j % arr[2] == 0 || j % arr[3] == 0) count++;
        }
        Console.WriteLine(count);
    }
}

using System;

namespace CF_148A
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());

            int count = int.Parse(Console.ReadLine());

            int result = 0;
            for (int i = 1; i <= count; i++)
            {
                if (i % k == 0) { result++; continue; }
                if (i % l == 0) { result++; continue; }
                if (i % m == 0) { result++; continue; }
                if (i % n == 0) { result++; continue; }
            }
            Console.WriteLine(result);
        }
    }
}

using System;

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

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

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

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

            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int count = 0;
            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0 || i %l==0 || i%m==0 || i % n == 0)
                {
                    count++;
                }
            }
            Console.WriteLine(count);

        }
    }
}

using System;
using System.IO;

namespace AcmSolution4
{
    class Program
    {
        static void Main(string[] args)
        {
#if !ONLINE_JUDGE
            Console.SetIn(new StreamReader("../../../a.txt"));
#endif

            var a = GetInt();
            var b = GetInt();
            var c = GetInt();
            var d = GetInt();
            var n = GetInt();

            int ans = 0;
            for (int i = 1; i <= n; ++i)
                if (i % a != 0 && i % b != 0 && i % c != 0 && i % d != 0)
                {
                    ++ans;
                }

            WL(n - ans);
        }

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

        static int GetInt(string s)
        {
            return int.Parse(s);
        }

        static int[] GetInts()
        {
            string[] ss = GetStrs();
            int[] nums = new int[ss.Length];

            int i = 0;
            foreach (string s in ss)
                nums[i++] = GetInt(s);

            return nums;
        }

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

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

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

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

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

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

class c105_p1
{
    static void Main()
    {
        //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);

        int k = int.Parse(Console.In.ReadLine());
        int l = int.Parse(Console.In.ReadLine());
        int m = int.Parse(Console.In.ReadLine());
        int n = int.Parse(Console.In.ReadLine());
        int d = int.Parse(Console.In.ReadLine());

        int counter = 0;
        for (int i = 1; i <= d; i++)
        {
            if (((i % k == 0) || (i % l == 0) || (i % m == 0) || (i % n == 0)))
                counter++;
        }

        Console.Out.WriteLine(counter);

        //out_sw.Close();
    }
}

using System;
using System.Numerics;
using System.Reflection;
using System.ComponentModel;

namespace WatermelonC
{
    class Program
    {
        static void Main(string[] args)
        {
            string firstLine = Console.ReadLine();
            string secondLine = Console.ReadLine();
            string thirdLine = Console.ReadLine();
            string fourthLine = Console.ReadLine();
            string fifthLine = Console.ReadLine();

            int m, n, o, p, j, x;
            x = 0;

            int.TryParse(firstLine, out m);
            int.TryParse(secondLine, out n);
            int.TryParse(thirdLine, out o);
            int.TryParse(fourthLine, out p);
            int.TryParse(fifthLine, out j);

            for (int i = 1; i <= j; i++)
            {
                if (i % m == 0)
                    x++;
                else if (i % n == 0)
                    x++;
                else if (i % o == 0)
                    x++;
                else if (i % p == 0)
                    x++;
            }

            Console.WriteLine(x);
        }
    }
}

using System;
using System.Collections.Generic;

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

            List<int> list = new List<int>();
            int counter = 0;
            for (int i = 0; i < 4; i++)
                list.Add(Convert.ToInt32(Console.ReadLine()));

            int total = Convert.ToInt32(Console.ReadLine());

            for (int i = 1; i <= total; i++)
            {
                if(
                    i % list[0]  != 0
                    & i % list[1]  != 0
                    & i % list[2]  != 0
                    & i % list[3] != 0)
                {
                    counter++;
                }
            }

            Console.WriteLine(total-counter);
        }
    }
}

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

public class A
    {
        public static void Main(string[] args)
        {
            string s = find();
            Console.ReadLine();
        }

        private static string find()
        {
            string k1 = Console.ReadLine();
            int k = int.Parse(k1);
            string l1 = Console.ReadLine();
            int l = int.Parse(l1);
            string m1 = Console.ReadLine();
            int m = int.Parse(m1);
            string n1 = Console.ReadLine();
            int n = int.Parse(n1);
            string d1 = Console.ReadLine();
            int d = int.Parse(d1);

            List<int> dr = new List<int>();
            int kTotal = 0;

            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    kTotal++;

            }

            Console.WriteLine(kTotal);
            return "";

        }

    }

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

namespace InsomniaCure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());

            int count = 0;

            for (int i = 1; i <= d; i++)
            {
                if ( (i % k == 0) ||
                     (i % l == 0) ||
                     (i % m == 0) ||
                     (i % n == 0) )
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			//var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();

			int k = int.Parse(Console.ReadLine());
			int l = int.Parse(Console.ReadLine());
			int m = int.Parse(Console.ReadLine());
			int n = int.Parse(Console.ReadLine());
			int d = int.Parse(Console.ReadLine());

			if (d == 0 || (k > d && l > d && m > d && n > d))
			{
				Console.WriteLine(0);
				return;
			}

			if (k == 1 || l == 1 || m == 1 || n == 1)
			{
				Console.WriteLine(d);
				return;
			}

			int count = 0;
			var dragons = Enumerable.Range(1, d);
			foreach (var dragon in dragons)
			{
				if (dragon % k == 0 || dragon % l == 0 || dragon % m == 0 || dragon % n == 0)
				{
					count++;
				}
			}

			Console.WriteLine(count);
		}

		//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;

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

        {

            int count = 0;
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            if(k==1||l==1||m==1||n==1)
                Console.WriteLine(d);
            else
            {
                for (int i = 1; i <= d; i++)
                {
                    if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                        count++;

                }
                Console.WriteLine(count);
            }
        }
    }
}

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

namespace ConsoleApplication1
{
    internal class Program
    {
        //static void PrintArray(char[,] a)
        //{
        //    for (int i = 0; i < a.GetLength(0); i++)
        //    {
        //        for (int j = 0; j < a.GetLength(1); j++)
        //        {
        //            Console.Write();
        //        }

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

        private static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine()),
                l = int.Parse(Console.ReadLine()),
                m = int.Parse(Console.ReadLine()),
                n = int.Parse(Console.ReadLine()),
                d = int.Parse(Console.ReadLine()),
                c = 0;

            for (int i = 1; i <= d; i++)
            {
                if (i%k != 0 && i%l != 0 && i%m != 0 && i%n != 0)
                    c++;
            }

            Console.WriteLine(d-c);
        }
    }
}

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

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] m = new int[5, 1];
            int count = 0;
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 1; j++)
                {
                    m[i, j] = Convert.ToInt32(Console.ReadLine());
                }
            }
            int[] m2 = new int[m[4, 0]];
            for (int i = 1; i <= m2.Length; i++)
            {
                m2[i - 1] = i;
            }
            for (int i = 0; i < 4; i++)
            {
                int n = m[i, 0];
                for (int j = n - 1; j < m2.Length; j += n)
                {
                    if (j >= m2.Length)
                    {
                        break;
                    }
                    if (m2[j] != 0)
                    {
                        m2[j] = 0;
                        count++;
                    }
                }
            }
            Console.WriteLine(count);
        }
    }
}

using System;
using System.Collections.Generic;

namespace _148A
{
    class Program
    {
        static void Main()
        {
            var damages = new int[4];
            for (var i = 0; i < damages.Length; i++)
                damages[i] = int.Parse(Console.ReadLine());

            var dragonsCount = int.Parse(Console.ReadLine());
            var hashset = new HashSet<int>();
            for (var i = 0; i < damages.Length; i++)
            for (var j = 1; j <= dragonsCount; j++)
                if (j % damages[i] == 0)
                    hashset.Add(j);

            Console.WriteLine(hashset.Count);
        }
    }
}

using System;

namespace ConsoleApp1
{
    internal class Program
    {

        private static void Main(string[] args)
        {

            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int count = 0;
            for(int i=1;i<= d;i++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    count++;

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

        }

        // Console.ReadKey();

    }

}

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 int NextInt(string[] a)
    {
        return int.Parse(a[__ptr++]);
    }

    static string[] ReadTokens(int n)
    {
        return Console.ReadLine().Split(SPACE, n);
    }

    //

    static void Prog()
    {
        __ptr = 0;
        int k = NextInt(ReadTokens(1));
        __ptr = 0;
        int l = NextInt(ReadTokens(1));
        __ptr = 0;
        int m = NextInt(ReadTokens(1));
        __ptr = 0;
        int n = NextInt(ReadTokens(1));
        __ptr = 0;
        int d = NextInt(ReadTokens(1));

        int count = 0;
        for (int i = 1; i <= d; i++)
        {
            if ((i % k == 0) || (i % l == 0) || (i % m == 0) || (i % n == 0))
                count++;
        }

        Console.WriteLine(count);
    }
}

using System;
using System.Text;
using System.ComponentModel;
using System.Linq;

namespace Calculating_Function
{
    class Program
    {
        static void Main()
        {
            int k = int.Parse(Console.ReadLine()), l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine()), n = int.Parse(Console.ReadLine());
            long d = long.Parse(Console.ReadLine());
            int c = 0;

            for (int i = 1; i <= d; i++)
            {
                if (i%k == 0 || i%l == 0 || i%m == 0 || i%n == 0)
                {
                    c++;
                }
            }
            Console.WriteLine(c);
        }
    }
}

using System;

namespace InsomniaCure
{
    internal class Program
    {
        private static void Main()
        {
            var k = int.Parse(Console.ReadLine().Trim());
            var l = int.Parse(Console.ReadLine().Trim());
            var m = int.Parse(Console.ReadLine().Trim());
            var n = int.Parse(Console.ReadLine().Trim());

            var d = int.Parse(Console.ReadLine().Trim());

            if (k == 1 || l == 1 || m == 1 || n == 1)
            {
                Console.WriteLine(d);
            }
            else
            {
                bool[] damageDragons = new bool[d];

                for (int i = k - 1; i < d; i += k)
                {
                    damageDragons[i] = true;
                }

                for (int i = l - 1; i < d; i += l)
                {
                    damageDragons[i] = true;
                }

                for (int i = m - 1; i < d; i += m)
                {
                    damageDragons[i] = true;
                }

                for (int i = n - 1; i < d; i += n)
                {
                    damageDragons[i] = true;
                }

                int result = 0;
                for (int i = 0; i < d; i++)
                {
                    if (damageDragons[i])
                    {
                        result++;
                    }
                }

                Console.WriteLine(result);
            }
        }
    }
}

using System;

namespace codeforces
{
    class Program
    {

        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int dragons = int.Parse(Console.ReadLine());
            int count = 0;

            for (int i = 1; i <= dragons; i++)
                count += (i%k==0||i%l==0||i%m==0||i%n==0)?1:0;

            Console.WriteLine(count);

        }
    }
}

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

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

            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int count = 0;
            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0 || i %l==0 || i%m==0 || i % n == 0)
                {
                    count++;
                }
            }
            Console.WriteLine(count);

        }
    }
}

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

    public class Program
    {
        public static void Main(string[] args)
        {
            var k = int.Parse(Console.ReadLine());
            var l = int.Parse(Console.ReadLine());
            var m = int.Parse(Console.ReadLine());
            var n = int.Parse(Console.ReadLine());
            var d = int.Parse(Console.ReadLine());
            var count = 0;
            var str = new StringBuilder();
            for (int i = 0; i < d; i++)
            {
                str.Append("X");
            }

            for (int i = k - 1; i < d; i = i + k)
            {
                str[i] = 'P';

            }
            for (int i = l - 1; i < d; i = i + l)
            {
                str[i] = 'P';

            }
            for (int i = m - 1; i < d; i = i + m)
            {
                str[i] = 'P';

            }
            for (int i = n - 1; i < d; i = i + n)
            {
                str[i] = 'P';

            }
            for (int i = 0; i < str.Length; i++)
            {
                if (str[i] == 'P')
                {
                    count++;
                }
            }
            Console.WriteLine(count);

        }
    }

//http://codeforces.com/problemset/problem/148/A

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

namespace CF___148A__Insomnia_cure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int[] arr = new int[d + 1];

            for (int i = k; i <= d; i += k)
                arr[i] = 1;
            for (int i = l; i <= d; i += l)
                arr[i] = 1;
            for (int i = m; i <= d; i += m)
                arr[i] = 1;
            for (int i = n; i <= d; i += n)
                arr[i] = 1;

            Console.WriteLine(arr.Sum());
        }
    }
}

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

namespace CF_InsomniaOff {
    class Program {
        static void Main(string[] args) {
            int k = Int32.Parse(Console.ReadLine());
            int l = Int32.Parse(Console.ReadLine());
            int m = Int32.Parse(Console.ReadLine());
            int n = Int32.Parse(Console.ReadLine());
            int d = Int32.Parse(Console.ReadLine());
            int result = 0;
            for(int i=1; i <= d; i++) {
                if(i % k  == 0) {
                    ++result;
                    continue;
                }
                if (i % l == 0) {
                    ++result;
                    continue;
                }
                if (i % m == 0) {
                    ++result;
                    continue;
                }
                if (i % n == 0) {
                    ++result;
                    continue;
                }
            }
            Console.WriteLine(result);
        }
    }
}

using System;

namespace qw4
{
	class MainClass
	{
		public static int nok(int a,int b)
		{
			int i=a,j=b;
			while (i != j)
			{
			if (i > j)
    			i -= j;
    		else
    			j -= i;
			};
			return (a/i)*(b/i)*i;
		}
		public static void Main (string[] args)
		{
			int k,l,m,n,d,nk,s;
			k=int.Parse(Console.ReadLine());
			l=int.Parse(Console.ReadLine());
			m=int.Parse(Console.ReadLine());
			n=int.Parse(Console.ReadLine());
			d=int.Parse(Console.ReadLine());
			nk=nok(nok(nok (k,l),m),n);
			//Console.WriteLine(nk);
			s=nk;
			for(int i=1;i<nk+1;i++)
			{
				if ((i%k==0)||(i%l==0)||(i%n==0)||(i%m==0))
					s--;
			};
			//Console.WriteLine(s);
			s=(d/nk)*s;

			for(int i=1;i<=(d%nk);i++)
			{
				if (!((i%k==0)||(i%l==0)||(i%n==0)||(i%m==0)))
					s++;
			};
			Console.WriteLine(d-s);

		}
	}
}

using System;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine()),
                l = int.Parse(Console.ReadLine()),
                m = int.Parse(Console.ReadLine()),
                n = int.Parse(Console.ReadLine()),
                d = int.Parse(Console.ReadLine());

            int x = (d / k) + (d / l) + (d / m) + (d / n)
                    - (d / LSM(k, l)) - (d / LSM(k, n)) - (d / LSM(k, m))
                    - (d / LSM(n, l)) - (d / LSM(m, l)) - (d / LSM(n, m))
                    + (d / LSM(k, l, m)) + (d / LSM(k, l, n)) + (d / LSM(k, n, m))
                    + (d / LSM(l, m, n)) - (d / LSM(k, l, m, n));

            Console.WriteLine(x);
        }

        static int GCD(int a, int b)
        {
            return b == 0 ? a : GCD(b, a % b);
        }

        static int LSM(int a, int b)
        {
            return Math.Abs(a * b) / GCD(a, b);
        }

        static int LSM(int a, int b, int c)
        {
            return LSM(LSM(a, b), c);
        }

        static int LSM(int a, int b, int c, int d)
        {
            return LSM(LSM(LSM(a, b), c), d);
        }
    }
}

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

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            var delims = new int[] { int.Parse(Console.ReadLine()), int.Parse(Console.ReadLine()), int.Parse(Console.ReadLine()), int.Parse(Console.ReadLine()) };
            var n = int.Parse(Console.ReadLine());
            var numbers = new bool[n];
            for (int i = 1; i <= n; i++)
                for (int g = 0; g < 4; g++)
                    if (i % delims[g] == 0)
                    {
                        numbers[i-1] = true;
                        break;
                    }
            Console.WriteLine(numbers.Where(x => x).Count());
        }
    }
}

 using System;
 class insumnia
 {
     static void Main()
     {
         int k = int.Parse(Console.ReadLine());
         int l = int.Parse(Console.ReadLine());
         int m = int.Parse(Console.ReadLine());
         int n = int.Parse(Console.ReadLine());
         int d = int.Parse(Console.ReadLine());
         int total = 0;

         for ( int i = 1; i <= d ; i++ )
         {
             if ( i%k != 0 && i%m != 0 && i%n !=0 && i%l !=0 )
             {
                 total+=0;
             }
             else
                 total++;
         }
         Console.WriteLine(total);

     }
 }

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

namespace Codeforces98
{
	class A105
	{
		static void Main(string[] args)
		{
			int ans = 0;
			int k = int.Parse(Console.ReadLine());
			int l = int.Parse(Console.ReadLine());
			int m = int.Parse(Console.ReadLine());
			int n = int.Parse(Console.ReadLine());
			int d = int.Parse(Console.ReadLine());
			for (int i = 1; i <= d; i++)
			{
				if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
					ans++;
			}

				Console.WriteLine(ans);

	//			Console.ReadKey();
		}
	}
}

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

namespace Codeforces__A.Слишком_длинные_слова_
{
    class RemedyForInsomnia
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int dragons=0;
            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    dragons++;
            }

            Console.WriteLine(dragons);
        }
    }
}

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

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            var k = Convert.ToInt32(Console.ReadLine());
            var l = Convert.ToInt32(Console.ReadLine());
            var m = Convert.ToInt32(Console.ReadLine());
            var n = Convert.ToInt32(Console.ReadLine());
            var d = Convert.ToInt32(Console.ReadLine());

            var result = new bool[d+1];

            for (int i = 1; i <= d; i++)
            {
                if ((i % k == 0) || (i % l ==0) || (i % m == 0) || (i % n == 0))
                {
                    result[i] = true;
                }
            }

            Console.WriteLine(result.Where(x=>x==true).Count());
        }

    }
}

using System;
using System.Linq;

namespace CSharp
{
    public class _148A
    {
        public static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            Console.WriteLine(Enumerable.Range(1, d).Count(i => i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0));
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int answer = 0;
            int dragon = 1;
            for (int i = 1; i <= d; i++)
            {
                if (dragon % k == 0 || dragon % l == 0 || dragon % m == 0 || dragon % n == 0)
                {
                    answer++;
                }
                dragon++;
            }

            Console.WriteLine(answer);

            Console.ReadLine();
        }
    }
}

using System;
using System.Linq;

class A148 {
    public static void Main() {
        var a = new int[4];
        for (int i = 0; i < 4; ++i) a[i] = int.Parse(Console.ReadLine());
        var d = int.Parse(Console.ReadLine());
        Console.WriteLine(Enumerable.Range(1, d).Count(i =>
            Array.Exists(a, k => i % k == 0)
        ));
    }
}

using System;

namespace CodeforcesSolution
{
    public class InsomniaCure
    {
        public static void Main(string[] args)
        {
            int k, l, m, n, d;
            k = int.Parse(Console.ReadLine());
            l = int.Parse(Console.ReadLine());
            m = int.Parse(Console.ReadLine());
            n = int.Parse(Console.ReadLine());
            d = int.Parse(Console.ReadLine());
            if (k == 1 || l == 1 || m == 1 || n == 1)
            {
                Console.WriteLine(d);
                return;
            }
            int count = 0;
            for (int i = 1; i <= d; i++)
            {
                if ((i % k == 0) || (i % l == 0) || (i % m == 0) || (i % n == 0))
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
}

using System;
using System.IO;
using System.Linq;
namespace codechef
{
    public class Program{
            public static StreamWriter writer;

            public static void RealWork()
            {
                int[] dragon = new int[5];
                for (int i = 0; i < 5; i++)
                    dragon[i] = intParse(Console.ReadLine());
                int Ans = 0;
                int[] map = new int[dragon[4]+1];
                for (int i = 0; i < 4; i++)
                {
                    for (int j = dragon[i]; j <= dragon[4]; j=j+dragon[i])
                        if (map[j] == 0)
                        {
                            map[j]++; Ans++;
                        }
                }
                writer.Write(Ans);
            }
            static void Main(string[] args)
            {
               writer = new StreamWriter(Console.OpenStandardOutput());
               //writer = new StreamWriter("output.txt");
               //Console.SetIn(new StreamReader(File.OpenRead("input.txt")));
                RealWork();
                writer.Close();
            }

            public static int intParse(string st)
            {
                int x = 0;
                for (int i = 0; i < st.Length; i++) { x = x * 10 + (st[i] - 48); }
                return x;
            }

    }

}

using System;
using System.Text;
using System.ComponentModel;
using System.Linq;

namespace Calculating_Function
{
    class Program
    {
        static void Main()
        {
            int k = int.Parse(Console.ReadLine()), l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine()), n = int.Parse(Console.ReadLine());
            long d = long.Parse(Console.ReadLine());
            int c = 0;

            for (int i = 1; i <= d; i++)
            {
                if (i%k == 0 || i%l == 0 || i%m == 0 || i%n == 0)
                {
                    c++;
                }
            }
            Console.WriteLine(c);
        }
    }
}

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

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            bool[] attack = new bool[d];

            for(int i = 0; i < d; i++)
            {
                attack[i] = false;
            }

            for (int i = k - 1; i < d; i+= k)
            {
                attack[i] = true;
            }

            for (int i = l - 1; i < d; i+= l)
            {
                attack[i] = true;
            }

            for (int i = m - 1; i < d; i+= m)
            {
                attack[i] = true;
            }

            for (int i = n - 1; i < d; i+= n)
            {
                attack[i] = true;
            }

            Console.WriteLine(attack.Count(i => i));

            Console.Read();
        }
    }
}

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

namespace задачи
{
    class Program
    {
        static void Main(string[] args)
        {
            int k, l, m, n, d,a=0;
            k = Convert.ToInt32(Console.ReadLine());
            l = Convert.ToInt32(Console.ReadLine());
            m = Convert.ToInt32(Console.ReadLine());
            n = Convert.ToInt32(Console.ReadLine());
            d = Convert.ToInt32(Console.ReadLine());//dlina
            int[,] b = new int[d,2];
            for (int i = 0; i < d; i++)
            {
                b[i,0] = i + 1;
            }

            for (int i = k-1; i < d; i+=k)
            {
                b[i, 1] = 1;
            }
            for (int i = l-1; i < d; i += l)
            {
                b[i, 1] = 1;
            }
            for (int i = m-1; i < d; i += m)
            {
                b[i, 1] = 1;
            }
            for (int i = n-1; i < d; i += n)
            {
                b[i, 1] = 1;
            }

            for (int i = 0; i < d; i++)
            {
                if (b[i, 1] == 1) { a++; }
            }
            Console.WriteLine(a);
          //  Console.ReadLine();
        }
    }
}

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

namespace _148A_Insomnia_Cure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int output = 0;

            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    output++;
            }

            Console.WriteLine(output);
        }
    }
}

using System;
class Solution
{
    public static void Main()
    {
        int[] arr = new int[5]; int count = 0;
        for (int i = 0; i < 5; i++) arr[i] = Convert.ToInt32(Console.ReadLine());
        for (int j = 1; j <= arr[4]; j++)
        {
            if (j % arr[0] == 0 || j % arr[1] == 0 || j % arr[2] == 0 || j % arr[3] == 0) count++;
        }
        Console.WriteLine(count);
    }
}

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

namespace codeforces
//#15 Resolve Insomnia cure
{
    class Program
    {
        static void Main(string[] args)
        {
            int input1 = int.Parse(Console.ReadLine()),
                input2 = int.Parse(Console.ReadLine()),
                input3 = int.Parse(Console.ReadLine()),
                input4 = int.Parse(Console.ReadLine()),
                all = int.Parse(Console.ReadLine()),
                remnant1 = 0, remnant2 = 0, remnant3 = 0, remnant4 = 0, sum = 0;
            for (int i = 0; i < all; i++)
            {
                if (i % input1 == 0) remnant1++;
                else if (i % input2 == 0) remnant2++;
                else if (i % input3 == 0) remnant3++;
                else if (i % input4 == 0) remnant4++;
            }
            sum = remnant1 + remnant2 + remnant3 + remnant4;

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

using System;
using System.Collections.Generic;

namespace Olymp
{
    public class Program
    {
        static void Z1A ()
        {
            uint n, m, a;
            string str = Console.ReadLine ();
            string [] strs = str.Split (' ');
            n = UInt32.Parse (strs [0]);
            m = UInt32.Parse (strs [1]);
            a = UInt32.Parse (strs [2]);

            uint nn = n / a;
            if (n % a > 0)
                nn++;
            uint nm = m / a;
            if (m % a > 0)
                nm++;
            ulong result = (ulong)nn * (ulong)nm;
            Console.WriteLine (result);
        }

        static void Z4A ()
        {
            int w = Int32.Parse (Console.ReadLine ());
            if (w % 2 == 0 && w > 2)
                Console.WriteLine ("YES");
            else
                Console.WriteLine ("NO");
        }

        static void Z158A ()
        {
            int n, k;
            string [] strs = Console.ReadLine ().Split (' ');
            n = Int32.Parse (strs [0]);
            k = Int32.Parse (strs [1]);
            strs = Console.ReadLine ().Split (' ');
            int max = 0;
            int i;
            for (i = 0; i < k; i++) {
                max = Int32.Parse (strs [i]);
                if (max == 0) {
                    Console.WriteLine (i);
                    return;
                }
            }
            int sum = k;
            for (; i < n; i++) {
                if (Int32.Parse (strs [i]) < max)
                    break;
                sum++;
            }
            Console.WriteLine (sum);
        }

        static void Z71A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            string str;
            for (int i = 0; i < n; i++) {
                str = Console.ReadLine ();
                if (str.Length > 10) {
                    Console.WriteLine (str [0] + (str.Length - 2).ToString () + str [str.Length - 1]);
                } else {
                    Console.WriteLine (str);
                }

            }
        }

        static void Z118A ()
        {
            string str = Console.ReadLine ();
            str = str.ToLower ();
            str = str.Replace ("a", "");
            str = str.Replace ("o", "");
            str = str.Replace ("y", "");
            str = str.Replace ("e", "");
            str = str.Replace ("u", "");
            str = str.Replace ("i", "");
            for (int i = 0; i < str.Length; i++) {
                Console.Write ("." + str [i]);
            }

        }

        static void Z50A ()
        {

            string   [] strs = Console.ReadLine ().Split (' ');
            int N = Int32.Parse (strs [0]);
            int M = Int32.Parse (strs [1]);
            int result = 0;
            result = (N / 2) * M;
            N %= 2;
            M /= 2;
            result += M * N;
            Console.WriteLine (result);

        }

        static void Z158B ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            string[] strs = Console.ReadLine ().Split (' ');
            int[] com = new int[4];
            for (int i = 0; i < 4; i++) {
                com [i] = 0;
            }
            int temp = 0;
            for (int i = 0; i < n; i++) {
                temp = Int32.Parse (strs [i]);
                com [temp - 1]++;
            }
            int sum = com [3];
            temp = Math.Min (com [2], com [0]);
            com [2] -= temp;
            com [0] -= temp;
            sum += temp;
            sum += com [2];
            sum += com [1] / 2;
            com [1] %= 2;
            sum += com [1];
            com [0] -= com [1] * 2;
            if (com [0] > 0) {

                sum += com [0] / 4;
                com [0] %= 4;
                if (com [0] > 0)
                    sum++;
            }
            Console.WriteLine (sum);

        }

        static void Z231A ()
        {

            int n = Int32.Parse (Console.ReadLine ());
            string[] strs;
            int sum = 0;

            for (int i = 0; i < n; i++) {
                strs = Console.ReadLine ().Split (' ');
                if (Int32.Parse (strs [0]) + Int32.Parse (strs [1]) + Int32.Parse (strs [2]) > 1)
                    sum++;
            }
            Console.WriteLine (sum);
        }

        static void Z282A ()
        {

            int n = Int32.Parse (Console.ReadLine ());
            int x = 0;
            string str;
            for (int i = 0; i < n; i++) {
                str = Console.ReadLine ();
                str = str.Replace ("X", "");
                if (str == "++") {
                    x++;
                } else {
                    x--;
                }
            }
            Console.WriteLine (x);
        }

        static  void Z116A ()
        {

            int n = Int32.Parse (Console.ReadLine ());
            int a = 0, b = 0;
            int sum = 0;
            int max = 0;
            string [] strs;
            for (int i = 0; i < n; i++) {
                strs = Console.ReadLine ().Split (' ');
                a = Int32.Parse (strs [0]);
                b = Int32.Parse (strs [1]);
                sum -= a;
                sum += b;
                if (sum > max) {
                    max = sum;
                }
            }
            Console.WriteLine (max);
        }

        static void Z131A ()
        {
            bool caps = true;
            string str = Console.ReadLine ();
            char first = str [0];
            for (int i = 1; i < str.Length; i++) {
                if (str [i] < 'A' || str [i] > 'Z')
                    caps = false;
            }
            if (caps) {
                str = str.ToLower ();
                if (first >= 'a' && first <= 'z')
                    first = first.ToString ().ToUpper () [0];
                else
                    first = first.ToString ().ToLower () [0];
                str = first + str.Substring (1);

            }
            Console.WriteLine (str);
        }

        static void Z96A ()
        {
            string str = Console.ReadLine ();
            int n = 0;
            char ch = 'w';
            for (int i = 0; i < str.Length; i++) {
                if (ch == str [i])
                    n++;
                else {
                    if (n >= 7) {
                        Console.WriteLine ("YES");
                        return;
                    }
                    ch = str [i];
                    n = 1;
                }
            }
            if (n < 7)
                Console.WriteLine ("NO");
            else
                Console.WriteLine ("YES");
        }

        static void Z266A ()
        {

            string str = Console.ReadLine ();
            str = Console.ReadLine ();
            int n = 0;
            int m = 0;
            char ch = ' ';
            for (int i = 0; i < str.Length; i++) {
                if (ch == str [i])
                    n++;
                else {
                    m += n;
                    ch = str [i];
                    n = 0;
                }
            }
            m += n;
            Console.WriteLine (m);
        }

        static void Z133A ()
        {
            string str = Console.ReadLine ();
            for (int i = 0; i < str.Length; i++) {
                if (str [i] == 'H' || str [i] == 'Q' || str [i] == '9') {

                    Console.WriteLine ("YES");
                    return;
                }

            }
            Console.WriteLine ("NO");

        }

        static void Z112A ()
        {
            string str1 = Console.ReadLine ();
            str1 = str1.ToLower ();
            string str2 = Console.ReadLine ();
            str2 = str2.ToLower ();
            int n = String.Compare (str1, str2);
            if (n != 0)
                Console.WriteLine (n / Math.Abs (n));
            else
                Console.WriteLine (0);
        }

        static void Z339A ()
        {
            int [] ch = new int[3];
            for (int i = 0; i < 3; i++) {
                ch [i] = 0;
            }
            string str = Console.ReadLine ();
            bool flag = false;
            for (int i = 0; i < str.Length; i++) {
                if (flag)
                    i++;
                else
                    flag = true;
                ch [Int32.Parse (str [i].ToString ()) - 1]++;
            }
            int j = 0;
            flag = false;
            while (j<3) {
                ch [j]--;

                if (ch [j] >= 0) {
                    if (flag) {
                        Console.Write ("+");
                    } else
                        flag = true;
                    Console.Write (j + 1);
                } else
                    j++;
            }
        }

        static void Z281A ()
        {
            string str = Console.ReadLine ();
            string f = str [0].ToString ();
            f = f.ToUpper ();
            str = f [0] + str.Substring (1);
            Console.Write (str);
        }

        static void Z82A ()
        {
            string[] names = new    string[5];
            names [0] = "Sheldon";
            names [1] = "Leonard";
            names [2] = "Penny";
            names [3] = "Rajesh";
            names [4] = "Howard";
            int n = Int32.Parse (Console.ReadLine ());
            int m = 5;
            while (m<n) {
                n -= m;
                m *= 2;
            }
            m /= 5;
            int i = 0;
            while (m<n) {
                n -= m;
                i++;
            }
            Console.Write (names [i]);
        }

        static void Z160A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            string[] str = Console.ReadLine ().Split (' ');
            List<int> moneys = new List<int> ();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                moneys.Add (Int32.Parse (str [i]));
                sum += moneys [i];
            }

            int[] armon = moneys.ToArray ();
            Array.Sort (armon);
            int blz = 0;
            int j = armon.Length - 1;
            int ni = 0;
            while (blz<=sum&&j>=0) {
                blz += armon [j];
                sum -= armon [j];
                j--;
                ni++;
            }
            Console.WriteLine (ni);
        }

        static void Z148A ()
        {
            int k=Int32.Parse(Console.ReadLine());
            int l=Int32.Parse(Console.ReadLine());
            int m=Int32.Parse(Console.ReadLine());
            int n=Int32.Parse(Console.ReadLine());
            int d=Int32.Parse(Console.ReadLine());
                int sum=0;

            for (int i = 0; i < d; i++) {
                if(i%k==0||i%l==0||i%m==0||i%n==0)
                    sum++;
            }
            Console.WriteLine(sum);
        }
        public static void Main ()
        {
            Z148A ();
        }

    }
}

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

namespace WarmingUpC_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int[] sorted = new int[4];
            sorted[0] = k; sorted[1] = l; sorted[2] = m; sorted[3] = n;
            Array.Sort(sorted);
            int harmed = 0;
            if (k == 1 || l == 1 || m == 1 || n == 1)
                Console.WriteLine(d);
            else
            {
                while (k <= d || l <= d || m <= d || n <= d)
                {
                    harmed += 4;
                    k *= 2; l *= 2; m *= 2; n *= 2;
                }
                Console.WriteLine(harmed + (sorted[0] - 1));
            }
        }
    }
}

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

namespace CF_InsomniaOff {
    class Program {
        static void Main(string[] args) {
            int k = Int32.Parse(Console.ReadLine());
            int l = Int32.Parse(Console.ReadLine());
            int m = Int32.Parse(Console.ReadLine());
            int n = Int32.Parse(Console.ReadLine());
            int d = Int32.Parse(Console.ReadLine());

            bool[] dragons = new bool[d];
            for(int i=0; i < d; i++) {
                if(i % k  == 0) {
                    dragons[i] = true;
                    continue;
                }
                if (i % l == 0) {
                    dragons[i] = true;
                    continue;
                }
                if (i % m == 0) {
                    dragons[i] = true;
                    continue;
                }
                if (i % n == 0) {
                    dragons[i] = true;
                    continue;
                }
            }
            int result = 0;
            for(int i = 0; i < d; ++i) {
                if(dragons[i] == true) {
                    result++;
                }
            }
            Console.WriteLine(result);
        }
    }
}

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

namespace InsomniaCure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());

            int count = 0;

            for (int i = 1; i < d; i++)
            {
                if ( (i % k == 0) ||
                     (i % l == 0) ||
                     (i % m == 0) ||
                     (i % n == 0) )
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}

using System;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			//var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();

			int k = int.Parse(Console.ReadLine());
			int l = int.Parse(Console.ReadLine());
			int m = int.Parse(Console.ReadLine());
			int n = int.Parse(Console.ReadLine());
			int d = int.Parse(Console.ReadLine());

			if (k == 1 || l == 1 || m == 1 || d == 1)
			{
				Console.WriteLine(d);
				return;
			}

			int count = 0;
			var dragons = Enumerable.Range(1, d);
			foreach (var dragon in dragons)
			{
				if (dragon % k == 0 || dragon % l == 0 || dragon % m == 0 || dragon % n == 0)
				{
					count++;
				}
			}

			Console.WriteLine(count);
		}

		//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;

    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
                int[] mas = new int[n];
                for (int i = 0; i < mas.Length; i++)
                {
                    mas[i] = 1;
                }
                if (a < n && b < n && c < n && d < n)
                {
                for (int i = 0; i < mas.Length; i = i + a)
                {
                    mas[i] = 0;
                }
                for (int i = 0; i < mas.Length; i = i + b)
                {
                    mas[i] = 0;
                }
                for (int i = 0; i < mas.Length; i = i + c)
                {
                    mas[i] = 0;
                }
                for (int i = 0; i < mas.Length; i = i + d)
                {
                    mas[i] = 0;
                }
            }
             int k = 0;
            for (int i = 0; i < mas.Length; i++)
            {
                if (mas[i] == 0) { k++; }
            }
            Console.Write(k);
            Console.ReadLine();
        }
    }

using System;
using System.Text;
using System.ComponentModel;
using System.Linq;

namespace Calculating_Function
{
    class Program
    {
        static void Main()
        {
            int k = int.Parse(Console.ReadLine()), l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine()), n = int.Parse(Console.ReadLine());
            long d = long.Parse(Console.ReadLine());
            int c = 0;

            for (int i = 0; i < d; i++)
            {
                if (i%k == 0 || i%l == 0 || i%m == 0 || i%n == 0)
                {
                    c++;
                }
            }
            Console.WriteLine(c);
        }
    }
}

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

namespace CSharpOlympTasks
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine()),
                l = int.Parse(Console.ReadLine()),
                m = int.Parse(Console.ReadLine()),
                n = int.Parse(Console.ReadLine()),
                d = int.Parse(Console.ReadLine());

            Console.WriteLine(d / k + l / k + m / k + n / k);

        }
    }
}

using static System.Console;class P{static void Main(){int k=int.Parse(ReadLine()),l=int.Parse(ReadLine()),m=int.Parse(ReadLine()),n=int.Parse(ReadLine()),d=int.Parse(ReadLine()),r=0;for(int i=0;i<d;i++)if(i%k==0||i%l==0||i%m==0||i%n==0)r++;WriteLine(r);}}

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

namespace CF_InsomniaOff {
    class Program {
        static void Main(string[] args) {
            int k = Int32.Parse(Console.ReadLine());
            int l = Int32.Parse(Console.ReadLine());
            int m = Int32.Parse(Console.ReadLine());
            int n = Int32.Parse(Console.ReadLine());
            int d = Int32.Parse(Console.ReadLine());
            int result = 0;
            bool[] dragons = new bool[d];
            for(int i=1; i <= d; i++) {
                if(i % k  == 0) {
                    dragons[i-1] = true;
                    ++result;
                    ++i;
                }
                if (i % l == 0) {
                    dragons[i-1] = true;
                    ++result;
                    ++i;
                }
                if (i % m == 0) {
                    dragons[i-1] = true;
                    ++result;
                    ++i;
                }
                if (i % n == 0) {
                    dragons[i-1] = true;
                    ++result;
                    ++i;
                }
            }
            Console.WriteLine(result);
        }
    }
}

using System;
using System.Linq;

namespace _148A_Princess
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int[] dracaris = new int[d];

            for (int i = 0; i < d; i+=k)
            {
                dracaris[i] = 1;
            }

            for (int i = 0; i < d; i += l)
            {
                dracaris[i] = 1;
            }

            for (int i = 0; i < d; i += m)
            {
                dracaris[i] = 1;
            }

            for (int i = 0; i < d; i += n)
            {
                dracaris[i] = 1;
            }

            Console.WriteLine(dracaris.Sum());
        }
    }
}

using System;

class Test
{
    static void Main()
    {
        int k = Int32.Parse(Console.ReadLine());
        int l = Int32.Parse(Console.ReadLine());
        int m = Int32.Parse(Console.ReadLine());
        int n = Int32.Parse(Console.ReadLine());
        int d = Int32.Parse(Console.ReadLine());
        int [] atmp = new int[d];

        for(int a=0 ; a<d ; a+=k){
            atmp[a] = 1;
        }
        for(int b=0 ; b<d ; b+=l){
            atmp[b] = 1;
        }
        for(int c=0 ; c<d ; c+=m){
            atmp[c] = 1;
        }
        for(int v=0 ; v<d ; v+=n){
            atmp[v] = 0;
        }
        int sum = 0;
        for(int i3 = 0 ;i3<d ; i3++){
            if(atmp[i3] == 1){
                sum++;
            }
        }
        Console.WriteLine(sum);
    }
}

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

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            var k = Convert.ToInt32(Console.ReadLine());
            var l = Convert.ToInt32(Console.ReadLine());
            var m = Convert.ToInt32(Console.ReadLine());
            var n = Convert.ToInt32(Console.ReadLine());
            var d = Convert.ToInt32(Console.ReadLine());

            var result = new bool[d];

            for (int i = 0; i < d; i++)
            {
                if ((i % k == 0) || (i % l ==0) || (i % m == 0) || (i % n == 0))
                {
                    result[i] = true;
                }
            }

            Console.WriteLine(result.Where(x=>x==true).Count());
        }

    }
}

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

namespace Training_Linklist_post_pre_infix
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());//|___Pan____|
            int l = int.Parse(Console.ReadLine());//|___Door___|
            int m = int.Parse(Console.ReadLine());//|___Pashne_|
            int n = int.Parse(Console.ReadLine());//|___Mom____|
            int d = int.Parse(Console.ReadLine());//|___TOTAL__|
            int j=0;
            for (int i = 0; i <= d; i++)
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    j++;

            Console.Write(j--);
        }
    }
}

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

namespace _148A {
    class Program {
        static void Main(string[] args) {
            int[] q = new int[4];
            for (int i = 0; i < q.Length; i++) {
                q[i] = int.Parse(Console.ReadLine());
            }
            int d = int.Parse(Console.ReadLine());

            bool[] arr = new bool[d];
            int count = 0;
            for (int i = 0; i < arr.Length; i++) {
                bool flag = false;
                if (i % q[0] == 0 || i % q[1] == 0 || i % q[2] == 0 || i % q[3] == 0) {
                    flag = true;
                }
                if (flag) {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
}

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

namespace MyProg
{

    class Program
    {
     static List<int> arr = new List<int>();
        static void Main(string[] args)
        {
            int d, CountOfINters = 0, sum = 0;

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

                arr.Add(int.Parse(Console.ReadLine()));
            }

            d = int.Parse(Console.ReadLine());

            Oraganize();

            if (arr.Count == 1)
            {
                Console.WriteLine(d / arr[0]);
                return;
            }

            int Mult =1; ;
            int cofactor =1;

            List<int> SavedData = new List<int>();
            for (int i = 0; i < arr.Count; i++)
            {
                Mult *= arr[i];

            }

            while (Mult * cofactor <= d)
            {
                SavedData.Add(Mult * cofactor);
                CountOfINters +=  arr.Count-1;
                cofactor++;
            }

            for (int i = 0; i < arr.Count - 1; i++)
            {

                sum += d / arr[i];

                for (int j = i + 1; j < arr.Count; j++)
                {

                    Mult = arr[i] * arr[j];
                    cofactor = 1;

                    while (Mult * cofactor <= d)
                    {
                        if (!SavedData.Contains(Mult * cofactor))
                        {
                            CountOfINters++;
                        }
                        cofactor++;
                    }
                }

            }

            sum += d / arr[arr.Count - 1];
           Console.WriteLine(sum- CountOfINters);

        }

        static public void Oraganize()
        {
            for (int i = 0; i < arr.Count; i++)
            {
                for (int k = 0; k < arr.Count; k++)
                {
                    if (i != k && arr[i] % arr[k] == 0)
                    {
                        arr.RemoveAt(i);
                        i--;
                        break;
                    }
                }
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static void Main()
    {
        var inp = new int[4];
        for (int i = 0; i < 4; i++)
        {
            inp[i] = int.Parse(Console.ReadLine());
        }
        var d = int.Parse(Console.ReadLine());
        if (inp.Contains(1))
        {
            Console.WriteLine(d);
            return;
        }
        if (d < inp[0] && d < inp[1] && d < inp[2] && d < inp[3])
        {
            Console.WriteLine(0);
            return;
        }
        var n = Enumerable.Range(1, d).ToDictionary(m => m, m => true);
        foreach (var item in inp)
        {
            if (!n[item])
            {
                continue;
            }
            for (var j = item; j <= d; j += item)
            {
                n[j] = false;
            }
        }
        var count = n.Count(b => b.Value == false);
    }
}

using System;
using System.Linq;

namespace tren
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = 0;
            var mass = Enumerable.Range(0, 5).Select(i => int.Parse(Console.ReadLine())).ToArray();
            for(int i = 1; i <= mass[4]; i++)
            {
                if (i % mass[0] == 0 || i % mass[1] == 0 || i % mass[2] == 0 || i % mass[3] == 0 || i % mass[4] == 0) count++;
            }
            Console.Write(count);
        }
    }
}

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

namespace Fun
{
	class Program
	{
		static void Main(string[] args)
		{
			var k = int.Parse(Console.ReadLine());
			var l = int.Parse(Console.ReadLine());
			var m = int.Parse(Console.ReadLine());
			var n = int.Parse(Console.ReadLine());
			var d = int.Parse(Console.ReadLine());

			int c = 0;
			for (int i = 0; i < d; i++)
			{
				if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
					c++;
			}
			Console.WriteLine(c);
		}
	}
}

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

namespace CF._148A
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            bool[] dragon = new bool[d];
            for (int i = 0; i < d; i++)
                dragon[i] = false;
            for (int i = 0; i < d; i += k)
                dragon[i] = true;
            for (int i = 0; i < d; i += l)
                dragon[i] = true;
            for (int i = 0; i < d; i += m)
                dragon[i] = true;
            for (int i = 0; i < d; i += n)
                dragon[i] = true;
            int count=0;
            for (int i = 0; i < d; i++)
                if (dragon[i])
                    count++;
            Console.WriteLine(count.ToString());
        }
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int sum = 0;
            int[] div = new int[4];
            div[0] = int.Parse(Console.ReadLine());
            div[1] = int.Parse(Console.ReadLine());
            div[2] = int.Parse(Console.ReadLine());
            div[3] = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            for (int i = 1; i <= n; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (i % div[j] == 0)
                    {
                        sum++;
                    }
                    break;
                }
            }
            Console.WriteLine(sum);
            Console.ReadLine();
        }

    }
}

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

namespace CF._148A
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            bool[] dragon = new bool[d];
            for (int i = 0; i < d; i++)
                dragon[i] = false;
            if (k <= d)
                for (int i = 0; i < d; i += k)
                    dragon[i] = true;
            if (l <= d)
                for (int i = 0; i < d; i += l)
                    dragon[i] = true;
            if (m <= d)
                for (int i = 0; i < d; i += m)
                    dragon[i] = true;
            if (n <= d)
                for (int i = 0; i < d; i += n)
                    dragon[i] = true;
            int count = 0;
            for (int i = 0; i < d; i++)
                if (dragon[i])
                    count++;
            Console.WriteLine(count.ToString());
        }
    }
}

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

namespace Test1
{
    public class Test1
    {
        public static void Main()
        {
            int[] dragons = Console.ReadLine().Split().Select(x=>Convert.ToInt32(x)).ToArray();
            bool[] beaten = new bool[dragons[dragons.Length-1]];
            for(int j=0; j<dragons.Length-1; j++)
            {
                for(int i=0; i<beaten.Length; i++)
                {
                    if((i+1)%dragons[j]==0){beaten[i]=true;}
                }
            }
            int total = beaten.Length;
            int unbeaten = 0;
            for(int i=0; i<beaten.Length; i++)
            {
                if(!beaten[i]) unbeaten++;
            }
            Console.WriteLine((total-unbeaten));
        }
    }
}

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

namespace _148A {
    class Program {
        static void Main(string[] args) {
            int[] q = new int[4];
            for (int i = 0; i < q.Length; i++) {
                q[i] = int.Parse(Console.ReadLine());
            }
            int d = int.Parse(Console.ReadLine());

            bool[] prime = new bool[d + 1];
            int count = 1;
            if (!q.Contains(1)) {
                for (int i = 0; i < prime.Length; i++) {
                    prime[i] = true;
                }
                prime[0] = prime[1] = false;
                for (int i = 2; i * i <= d; ++i) {
                    if (prime[i]) {
                        for (int j = i * i; j <= d; j += i) {
                            prime[j] = false;
                        }
                    }
                }
                for (int i = 0; i < prime.Length; i++) {
                    if (prime[i] && !q.Contains(i) && i > q.Min()) {
                        //Console.WriteLine(i);
                        count++;
                    }
                }
                if (count != 1)
                    count = d - count;
                else
                    count = 0;
            } else {
                count = d;
            }
            Console.WriteLine(count);

        }
    }
}

using System;

namespace palindrome
{
	class Program
	{
		public static void Main(string[] args)
		{
			int k = int.Parse(Console.ReadLine());
			int l = int.Parse(Console.ReadLine());
			int m = int.Parse(Console.ReadLine());
			int n = int.Parse(Console.ReadLine());
			int d = int.Parse(Console.ReadLine());

			bool [] c = new bool[d+1];
			int cont = 0;
			for (int i = 1; i <= d; i+= k) {
				if (!c[i])
				{
					cont++;
					c[i] = true;
				}
			}

			for (int i = 1; i <= d; i+= l) {
				if (!c[i])
				{
					cont++;
					c[i] = true;
				}
			}

			for (int i = 1; i <= d; i+= m) {
				if (!c[i])
				{
					cont++;
					c[i] = true;
				}
			}

			for (int i = 1; i <= d; i+= n) {
				if (!c[i])
				{
					cont++;
					c[i] = true;
				}
			}

			Console.WriteLine(cont);
		}
	}
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine()),
                l = Convert.ToInt32(Console.ReadLine()),
                m = Convert.ToInt32(Console.ReadLine()),
                n = Convert.ToInt32(Console.ReadLine()),
                d = Convert.ToInt32(Console.ReadLine()),
                output = 0;
            for(int i = 0; i < d; i ++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % m == 0 || i % n == 0)
                    output++;
            }
            Console.Write(output);
        }
    }
}

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 Task148A
	{
		private class Solver
		{
			private InputTokenizer input = new InputTokenizer();
			private TextWriter output = Console.Out;

			public void Solve()
			{
				int k, l, m, n, d;
				input.Line().Read(out k)
						 .Line().Read(out l)
						 .Line().Read(out m)
						 .Line().Read(out n)
						 .Line().Read(out d);

				int ans = 0;
				for (int i = 1; i <= d; ++i)
					if (i % k == 0 || i % l == 0 || i % m == 0)
						++ans;

				output.WriteLine(ans);
			}
		}

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

namespace Drinks
{
    class Program
    {
        static void Main(string[] args)
        {
            float n = float.Parse(Console.ReadLine());
            //float[] p = Array.ConvertAll(Console.ReadLine().Split(), float.Parse);
            //float a = 0;
            //for (int i = 0; i < p.Length; i++)
            //{
            //    a += p[i];
            //}
            //Console.WriteLine(a / n);
            //Console.WriteLine(Array.ConvertAll(Console.ReadLine().Split(), float.Parse).Sum()/n);
            Console.WriteLine(Console.ReadLine().Split().Select(float.Parse).Sum() / n);
            Console.ReadLine();
        }
    }
}

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

namespace Test1
{
    public class Test1
    {
        public static void Main()
        {
            int[] dragons = Console.ReadLine().Split().Select(x=>Convert.ToInt32(x)).ToArray();
            bool[] beaten = new bool[dragons[dragons.Length-1]];
            for(int j=0; j<dragons.Length-1; j++)
            {
                for(int i=0; i<beaten.Length; i++)
                {
                    if((i+1)%dragons[j]==0){beaten[i]=true;}
                }
            }
            int bbeaten = 0;
            for(int i=0; i<beaten.Length; i++)
            {
                if(beaten[i]) bbeaten++;
            }
            Console.WriteLine(bbeaten);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static IEnumerable<int> gp(int max)
    {
        var n = Enumerable.Range(2, max - 1).ToDictionary(m => m, m => true);
        for (var i = 2; i <= (max / 2); i++)
        {
            if (!n[i])
            {
                continue;
            }

            for (var j = 2 * i; j <= max; j += i)
            {
                n[j] = false;
            }
        }

        return n.Where(kv => kv.Value).Select(kv => kv.Key);
    }
    static void Main()
    {
        var inp = new int[5];
        for (int i = 0; i < 4; i++)
        {
            inp[i] = int.Parse(Console.ReadLine());
        }
        var d = int.Parse(Console.ReadLine());
        if (inp.Contains(1))
        {
            Console.WriteLine(d);
            return;
        }
        if (d < inp[0] && d < inp[1] && d < inp[2] && d < inp[3])
        {
            Console.WriteLine(0);
            return;
        }
        var primes = gp(d).Count(p => !inp.Contains(p)) + 1;
        Console.WriteLine(d - primes);
    }
}

using System;
using System.IO;
using System.Linq;
namespace codechef
{
    public class Program{
            public static StreamWriter writer;

            public static void RealWork()
            {
                int[] dragon = new int[5];
                for (int i = 0; i < 5; i++)
                    dragon[i] = intParse(Console.ReadLine());
                int Ans = 0;
                int[] map = new int[dragon[4]+1];
                for (int i = 0; i < 5; i++)
                {
                    for (int j = dragon[i]; j <= dragon[4]; j=j+dragon[i])
                        if (map[j] == 0)
                        {
                            map[j]++; Ans++;
                        }
                }
                writer.Write(Ans);
            }
            static void Main(string[] args)
            {
               writer = new StreamWriter(Console.OpenStandardOutput());
               //writer = new StreamWriter("output.txt");
               //Console.SetIn(new StreamReader(File.OpenRead("input.txt")));
                RealWork();
                writer.Close();
            }

            public static int intParse(string st)
            {
                int x = 0;
                for (int i = 0; i < st.Length; i++) { x = x * 10 + (st[i] - 48); }
                return x;
            }

    }

}

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

namespace _148A {
    class Program {
        static void Main(string[] args) {
            int[] q = new int[4];
            for (int i = 0; i < q.Length; i++) {
                q[i] = int.Parse(Console.ReadLine());
            }
            int d = int.Parse(Console.ReadLine());

            Console.WriteLine("===");
            bool[] prime = new bool[d + 1];
            int count = 1;
            if (!q.Contains(1)) {
                for (int i = 0; i < prime.Length; i++) {
                    prime[i] = true;
                }
                prime[0] = prime[1] = false;
                for (int i = 2; i * i <= d; ++i) {
                    if (prime[i]) {
                        for (int j = i * i; j <= d; j += i) {
                            prime[j] = false;
                        }
                    }
                }
                for (int i = 0; i < prime.Length; i++) {
                    if (prime[i] && !q.Contains(i) && i > q.Min()) {
                        //Console.WriteLine(i);
                        count++;
                    }
                }
                if (count != 1)
                    count = d - count;
                else
                    count = 0;
            } else {
                count = d;
            }
            Console.WriteLine(count);

        }
    }
}

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

namespace Средство_от_бессонницы
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int z = 0;
            for (int i = 0; i < d; i++)
            {
                if (i % k == 0)
                    z++;
                else if (i % l == 0)
                    z++;
                else if (i % m == 0)
                    z++;
                else if (i % n == 0)
                    z++;
            }
            Console.WriteLine(z);

        }
    }
}

using System;

public class InsomniaCure
{
	private static void Main()
	{
		var k = int.Parse(Console.ReadLine());
		var l = int.Parse(Console.ReadLine());
		var m = int.Parse(Console.ReadLine());
		var n = int.Parse(Console.ReadLine());
		var d = int.Parse(Console.ReadLine());

		var output = 0;
		for (int i = 0; i < d; i++)
		{
			if(i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
			{
				output++;
			}
		}

		Console.WriteLine(output);
	}
}

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

namespace CSharpOlympTasks
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine()),
                l = int.Parse(Console.ReadLine()),
                m = int.Parse(Console.ReadLine()),
                n = int.Parse(Console.ReadLine()),
                d = int.Parse(Console.ReadLine()),
                count = 0;

            var divisors = new List<int>() { k };
            if (l % k != 0)
                divisors.Add(l);

            if (m % l != 0 && m % k != 0)
                divisors.Add(m);

            if (n % m != 0 && n % l != 0 && n % k != 0)
                divisors.Add(m);

            for (int i = 1; i <= d; ++i)
                if (divisors.Any(e => i % e == 0))
                    ++count;

            Console.WriteLine(count);
        }
    }
}

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

namespace Codeforces__A.Слишком_длинные_слова_
{
    class RemedyForInsomnia
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int dragons=0;
            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    dragons++;
            }
        }
    }
}

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

namespace codeforces
//#15 Resolve Insomnia cure
{
    class Program
    {
        static void Main(string[] args)
        {
            int input1 = int.Parse(Console.ReadLine()),
                input2 = int.Parse(Console.ReadLine()),
                input3 = int.Parse(Console.ReadLine()),
                input4 = int.Parse(Console.ReadLine()),
                all = int.Parse(Console.ReadLine()),
                remnant1 = 0, remnant2 = 0, remnant3 = 0, remnant4 = 0, sum = 0;
            for (int i = 0; i < all; i++)
            {
                if (i % input1 == 0 && all>= input1) remnant1++;
                else if (i % input2 == 0 && all >= input2) remnant2++;
                else if (i % input3 == 0 && all >= input3) remnant3++;
                else if (i % input4 == 0 && all >= input4) remnant4++;
            }
            sum = remnant1 + remnant2 + remnant3 + remnant4;

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

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

namespace _148A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[]a = new string[5];
            bool flag = false;
            for (int i = 0; i < 5; i++)
            {
                a[i] = Console.ReadLine();
                if (a[i] == "1")
                {
                    flag = true;
                }
            }
            if (flag)
            {
                Console.Write(a[4]);
            }
            else
            {
                int count = 0;
                for (int i = 1; i <= Convert.ToInt32(a[4]); i++)
                {
                    if (i % Convert.ToInt32(a[0]) == 0 || i % Convert.ToInt32(a[1]) == 0 || i % Convert.ToInt32(a[2]) == 0 || i % Convert.ToInt32(a[3]) == 0)
                    {
                        count++;
                    }
                }
                Console.Write(count);
            }
            Console.ReadLine();
        }
    }
}

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

namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            bool[] b = new bool[d];
            int f = 0;
            for (int i = 0; i < d; i += k)
            {
                if (b[i] == false)
                {
                    f++;
                    b[i] = true;
                }
                else
                {
                    b[i] = true;
                }
            }
            for (int i = 0; i < d; i += m)
            {
                if (b[i] == false)
                {
                    f++;
                    b[i] = true;
                }
                else
                {
                    b[i] = true;
                }
            }
            for (int i = 0; i < d; i += n)
            {
                if (b[i] == false)
                {
                    f++;
                    b[i] = true;
                }
                else
                {
                    b[i] = true;
                }
            }
            for (int i = 0; i < d; i += l)
            {
                if (b[i] == false)
                {
                    f++;
                    b[i] = true;
                }
                else
                {
                    b[i] = true;
                }
            }
            Console.WriteLine(f);

        }
    }
}

using System;

class Test
{
    static void Main()
    {
        int k = Int32.Parse(Console.ReadLine());
        int l = Int32.Parse(Console.ReadLine());
        int m = Int32.Parse(Console.ReadLine());
        int n = Int32.Parse(Console.ReadLine());
        int d = Int32.Parse(Console.ReadLine());
        int [] atmp = new int[d];

        for(int a=0 ; a<d ; a+=k){
            atmp[a] = 1;
        }
        for(int b=0 ; b<d ; b+=l){
            atmp[b] = 1;
        }
        for(int c=0 ; c<d ; c+=m){
            atmp[c] = 1;
        }
        for(int v=0 ; v<d ; v+=n){
            atmp[v] = 1;
        }
        int sum = 0;
        for(int i3 = 0 ;i3<d ; i3++){
            if(atmp[i3] == 1){
                sum++;
            }
        }
        Console.WriteLine(sum);
    }
}

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

namespace InsomniaCure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());

            int count = 0;

            for (int i = 1; i < d; i++)
            {
                if ( (i % k == 0) ||
                     (i % l == 0) ||
                     (i % m == 0) ||
                     (i % n == 0) )
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}

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

namespace ProblemsFun
{
    class Program
    {
        static void Main(string[] args)
        {
            int k, l, m, n, d;
            k = Convert.ToInt32(Console.ReadLine());
            l = Convert.ToInt32(Console.ReadLine());
            m = Convert.ToInt32(Console.ReadLine());
            n = Convert.ToInt32(Console.ReadLine());
            d = Convert.ToInt32(Console.ReadLine());

            int count = 0;
            for (int i = 0; i < d; i++ )
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    count++;
            }
                Console.WriteLine(count);
        }

    }
}

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

namespace Codeforces98
{
	class A105
	{
		static void Main(string[] args)
		{
			int ans = 0;
			int k = int.Parse(Console.ReadLine());
			int l = int.Parse(Console.ReadLine());
			int m = int.Parse(Console.ReadLine());
			int n = int.Parse(Console.ReadLine());
			int d = int.Parse(Console.ReadLine());
			for (int i = 0; i < d; i++)
			{
				if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
					ans++;
			}

				Console.WriteLine(ans);

	//			Console.ReadKey();
		}
	}
}

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

namespace CodeForces
{
    class _148A
    {
        public static void Main()
        {
            int k = Int32.Parse(Console.ReadLine());
            int l = Int32.Parse(Console.ReadLine());
            int m = Int32.Parse(Console.ReadLine());
            int n = Int32.Parse(Console.ReadLine());
            int totalDragons = Int32.Parse(Console.ReadLine());
            for (int i = 0; i < totalDragons; i++)
            {
                if (i % k == 0 || i % l == 0 | i % m == 0 || i % n == 0)
                {

                }
            }
        }
    }
}

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

    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int [] mas=new int [n];
            for (int i = 0; i < mas.Length; i++)
            {
                mas[i] = 1;
            }
            for (int i = 0; i < mas.Length; i=i+a)
            {
                mas[i] = 0;
            }
            for (int i = 0; i < mas.Length; i = i + b)
            {
                mas[i] = 0;
            }
            for (int i = 0; i < mas.Length; i = i + c)
            {
                mas[i] = 0;
            }
            for (int i = 0; i < mas.Length; i = i + d)
            {
                mas[i] = 0;
            }
            int k = 0;
            for (int i = 0; i < mas.Length; i++)
            {
                if (mas[i] == 0) { k++; }
            }
            Console.Write(k);
            Console.ReadLine();
        }
    }

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

namespace Insomnia_Cure_148A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = new int[5];
            for (int i = 0; i < 5; i++)
            {
                input[i] = int.Parse(Console.ReadLine());
            }
            int count = 0;
            for (int i = 0; i < input[4]; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (i % input[j] == 0)
                    {
                        count++;
                        break;
                    }
                }
            }
            Console.WriteLine(count);

        }
    }
}

using System;
using System.Linq;

namespace _148A_Princess
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int[] dracaris = new int[d];

            for (int i = 0; i < d; i+=k)
            {
                dracaris[i] = 1;
            }

            for (int i = 0; i < d; i += l)
            {
                dracaris[i] = 1;
            }

            for (int i = 0; i < d; i += m)
            {
                dracaris[i] = 1;
            }

            for (int i = 0; i < d; i += n)
            {
                dracaris[i] = 1;
            }

            Console.WriteLine(dracaris.Sum());
        }
    }
}

using System;

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

            int count = 0;

            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());

            int d = int.Parse(Console.ReadLine());

            int min = Math.Min(k, l);
            min = Math.Min(min, m);
            min = Math.Min(min, n);

            count = min - 1;

            for (int i = min; i < d; i++)
            {

                if (i % k == 0)
                    continue;

                if (i % l == 0)
                    continue;

                if (i % m == 0)
                    continue;

                if (i % n == 0)
                    continue;

                    count++;
            }

            Console.WriteLine(d - count);
        }
    }
}

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

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input=new int[5];
            int number = 0;
            for (int i = 0; i < input.Length; i++)
            {
                input[i] = Convert.ToInt32(Console.ReadLine());
            }
            number = input[input.Length - 1];
            for (int i = 0; i < input[input.Length - 1]; i++)
            {

                if (i % input[0] != 0 && i % input[2] != 0 && i % input[1] != 0 && i % input[3] != 0)
                {
                    number--;
                }
            }
            Console.WriteLine(number);
        }
    }
}

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

namespace ConsoleApplication2
{
    class Program
    {

        static void Main()
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            bool[] dr = new bool[d];
            int count = 0;

            if (k == 1 || l == 1 || m == 1 || n == 1)
                Console.WriteLine(d);
            else
            {
                for (int i = 0; i < d; i = i + k)
                    dr[i] = true;

                for (int i = 0; i < d; i = i + l)
                    dr[i] = true;

                for (int i = 0; i < d; i = i + m)
                    dr[i] = true;

                for (int i = 0; i < d; i = i + n)
                    dr[i] = true;

                for (int i = 0; i < d; i++)
                {
                    if (dr[i] == true)
                        count++;
                }

                Console.WriteLine(count);
            }

        }
    }
}

using System;

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

        {

            int count = 0;
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            if(k==1||l==1||m==1||n==1)
                Console.WriteLine(d);
            else
            {
                for (int i = 1; i <= d; i++)
                {
                    if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                        count++;
                    Console.WriteLine(count);
                }
                Console.WriteLine(count);
            }
        }
    }
}

using System;
using System.Linq;

namespace Drinks
{
    class Program
    {
        static void Main(string[] args)
        {
            float n = float.Parse(Console.ReadLine());
            //float[] p = Array.ConvertAll(Console.ReadLine().Split(), float.Parse);
            //float a = 0;
            //for (int i = 0; i < p.Length; i++)
            //{
            //    a += p[i];
            //}
            //Console.WriteLine(a / n);
            //Console.WriteLine(Array.ConvertAll(Console.ReadLine().Split(), float.Parse).Sum()/n);
            Console.WriteLine(Console.ReadLine().Split().Select(float.Parse).Sum() / n);
            Console.ReadLine();
        }
    }
}

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

namespace ConsoleApplication2
{
    class Program
    {

        static void Main()
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            bool[] dr = new bool[d];
            int count = 0;

            if (k == 1 || l == 1 || m == 1 || n == 1)
                Console.WriteLine(d);
            else
            {
                for (int i = k; i < d; i = i + k)
                    dr[i] = true;

                for (int i = l; i < d; i = i + l)
                    dr[i] = true;

                for (int i = m; i < d; i = i + m)
                    dr[i] = true;

                for (int i = n; i < d; i = i + n)
                    dr[i] = true;

                for (int i = 0; i < d; i++)
                {
                    if (dr[i] == true)
                        count++;
                }

                Console.WriteLine(count);
            }

        }
    }
}

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

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input=new int[5];
            for (int i = 0; i < input.Length; i++)
            {
                input[i] = Convert.ToInt32(Console.ReadLine());
            }
            int number = input[input.Length - 1];
            for (int i = 1; i <= number; i++)
            {

                if (i % input[0] != 0 && i % input[2] != 0 && i % input[1] != 0 && i % input[3] != 0)
                {
                    number--;
                }
            }
            Console.WriteLine(number);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static void Main()
    {
        var inp = new int[4];
        for (int i = 0; i < 4; i++)
        {
            inp[i] = int.Parse(Console.ReadLine());
        }
        var d = int.Parse(Console.ReadLine());
        if (inp.Contains(1))
        {
            Console.WriteLine(d);
            return;
        }
        if (d < inp[0] && d < inp[1] && d < inp[2] && d < inp[3])
        {
            Console.WriteLine(0);
            return;
        }
        var n = Enumerable.Range(1, d).ToDictionary(m => m, m => true);
        foreach (var item in inp)
        {
            if (!n[item])
            {
                continue;
            }
            for (var j = item; j <= d; j += item)
            {
                n[j] = false;
            }
        }
        var count = n.Count(b => b.Value == false);
    }
}

using System;

namespace AcmSolution
{
    class Program
    {
        static void Main(string[] args)
        {
#if !ONLINE_JUDGE
            Console.SetIn(new StreamReader("../../../a.txt"));
#endif

#if !ONLINE_JUDGE
            Console.ReadLine();
#endif
        }

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

        static int GetInt(string s)
        {
            return int.Parse(s);
        }

        static int[] GetInts()
        {
            string[] ss = GetStrs();
            int[] nums = new int[ss.Length];

            int i = 0;
            foreach (string s in ss)
                nums[i++] = GetInt(s);

            return nums;
        }

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

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

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

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

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

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

    public class Program
    {
        public static void Main(string[] args)
        {
            var k = int.Parse(Console.ReadLine());
            var l = int.Parse(Console.ReadLine());
            var m = int.Parse(Console.ReadLine());
            var n = int.Parse(Console.ReadLine());
            var d = int.Parse(Console.ReadLine());
            var count = 0;
            var str = new StringBuilder();
            for (int i = 0; i < d; i++)
            {
                str.Append("X");
            }

            for (int i = k - 1; i < d; i = i + k)
            {
                str[i] = 'P';

            }
            for (int i = k - 1; i < d; i = i + l)
            {
                str[i] = 'P';

            }
            for (int i = k - 1; i < d; i = i + m)
            {
                str[i] = 'P';

            }
            for (int i = k - 1; i < d; i = i + n)
            {
                str[i] = 'P';

            }
            for (int i = 0; i < str.Length; i++)
            {
                if (str[i] == 'P')
                {
                    count++;
                }
            }
            Console.WriteLine(count);

        }
    }

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static IEnumerable<int> gp(int max)
    {
        var n = Enumerable.Range(2, max - 1).ToDictionary(m => m, m => true);
        for (var i = 2; i <= (max / 2); i++)
        {
            if (!n[i])
            {
                continue;
            }

            for (var j = 2 * i; j <= max; j += i)
            {
                n[j] = false;
            }
        }

        return n.Where(kv => kv.Value).Select(kv => kv.Key);
    }
    static void Main()
    {
        var inp = new int[5];
        for (int i = 0; i < 4; i++)
        {
            inp[i] = int.Parse(Console.ReadLine());
        }
        var d = int.Parse(Console.ReadLine());
        if (inp.Contains(1))
        {
            Console.WriteLine(d);
            return;
        }
        if (d < inp[0] && d < inp[1] && d < inp[2] && d < inp[3])
        {
            Console.WriteLine(0);
            return;
        }
        var primes = gp(d).Where(p => !inp.Contains(p));
        var count = primes.Count();
        foreach (var item in primes)
        {
            var i = item;
            do
            {
                i += i;
            } while (i <= d);
            count += i;
        }
        Console.WriteLine(d - count);
    }
}

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

namespace Codeforces98
{
	class A105
	{
		static void Main(string[] args)
		{
			int ans = 0;
			int k = int.Parse(Console.ReadLine());
			int l = int.Parse(Console.ReadLine());
			int m = int.Parse(Console.ReadLine());
			int n = int.Parse(Console.ReadLine());
			int d = int.Parse(Console.ReadLine());
			for (int i = 0; i < d; i++)
			{
				if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
					ans++;
			}

				Console.WriteLine(ans);

	//			Console.ReadKey();
		}
	}
}

using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());
            int temp = 0;
            for (int i=1; i<=d;i++)
            {
                if (i%k==0) { temp++; continue; }
                if (i % l == 0) { temp++; continue; }
                if (i % m == 0) { temp++; continue; }
                if (i % n == 0) { temp++; continue; }
                if (i % d == 0) { temp++; continue; }
            }
            Console.WriteLine(temp);
        }
    }
}

 using System;
 class insumnia
 {
     static void Main()
     {
         int k = int.Parse(Console.ReadLine());
         int l = int.Parse(Console.ReadLine());
         int m = int.Parse(Console.ReadLine());
         int n = int.Parse(Console.ReadLine());
         int d = int.Parse(Console.ReadLine());
         int total = 0;

         if ( k == 1 )
             total = d;
         else
         {
             for ( int i=0 ; k*i < d ; i++ )
             {
                 total++;
             }
             for ( int i=0 ; m*i < d || n*i < d || l*i < d ; i++)
             {
                 if ( (m*i)%k != 0 && m*i < d)
                     total++;
                 if ( (n*i)%k != 0 && (n*i)%m != 0 && n*i < d)
                     total++;
                 if ( (l*i)%k != 0 && (l*i)%m != 0 && (l*i)%n != 0 && l*i < d)
                     total++;
             }
         }

         Console.WriteLine(total);

     }
 }

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

namespace Test1
{
    public class Test1
    {
        public static void Main()
        {
            string input = Console.ReadLine();
            bool willPrint = false;
            for(int i=0; i<input.Length; i++)
            {
                if(Convert.ToChar(input.Substring(i,1))=='H' || Convert.ToChar(input.Substring(i,1))=='Q' || Convert.ToChar(input.Substring(i,1))=='9')
                {
                    willPrint = true;
                    break;
                }
            }

            if(willPrint) Console.WriteLine("YES");
            else Console.WriteLine("NO");
        }
    }
}

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

namespace C0deforces
{
    class InsomniaCure
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine().Trim());
            int l = int.Parse(Console.ReadLine().Trim());
            int m = int.Parse(Console.ReadLine().Trim());
            int n = int.Parse(Console.ReadLine().Trim());
            int d = int.Parse(Console.ReadLine().Trim());
            int a = k, b = l, c = m, e = n;
            int[] dragons = new int[d];
            while (k < d || l < d || m < d || n < d)
            {
                if (k < d) { dragons[k] = -1; }
                if (l < d) { dragons[l] = -1; }
                if (m < d) {dragons[m] = -1;  }
                if (n < d) {dragons[n] = -1;  }
                k += a;l += b;m += c;n += e;
            }
            int safe = 0;
            for (int i = 0; i < d; i++)
            {
                if (dragons[i] == -1) {safe++;}
            }
            Console.WriteLine(safe);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static IEnumerable<int> gp(int max)
    {
        var n = Enumerable.Range(2, max - 1).ToDictionary(m => m, m => true);
        for (var i = 2; i <= (max / 2); i++)
        {
            if (!n[i])
            {
                continue;
            }

            for (var j = 2 * i; j <= max; j += i)
            {
                n[j] = false;
            }
        }

        return n.Where(kv => kv.Value).Select(kv => kv.Key);
    }
    static void Main()
    {
        var inp = new int[5];
        for (int i = 0; i < 4; i++)
        {
            inp[i] = int.Parse(Console.ReadLine());
        }
        var d = int.Parse(Console.ReadLine());
        if (inp.Contains(1))
        {
            Console.WriteLine(d);
            return;
        }
        if (d < inp[0] && d < inp[1] && d < inp[2] && d < inp[3])
        {
            Console.WriteLine(0);
            return;
        }
        var primes = gp(d).Where(p => !inp.Contains(p));
        var count = primes.Count();
        foreach (var item in primes)
        {
            count += d / item;
        }
        Console.WriteLine(d - count);
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            byte k, l, m, n;
            k = Byte.Parse(Console.ReadLine());
            l = Byte.Parse(Console.ReadLine());
            m = Byte.Parse(Console.ReadLine());
            n = Byte.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int count = 0;
            if (k==1)
            {
                count = d;
            }
            else
            {
                count += d / k;
                d = d / k;
                count += d / l;
                d = d / l;
                count += d / m;
                d = d / m;
                count += d / n;
                d = d / n;
            }
            Console.WriteLine(count);
        }
    }
}

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

namespace CF_148A
{
    class Program
    {
        static void Main()
        {
            var k = int.Parse(Console.ReadLine());
            var l = int.Parse(Console.ReadLine());
            var m = int.Parse(Console.ReadLine());
            var n = int.Parse(Console.ReadLine());
            var d = int.Parse(Console.ReadLine());

            if (k == 1) Console.WriteLine(d);
            else
            {
                var list = new List<int>{k};
                if (l%k != 0 && l%m != 0 && l%n != 0)
                {
                    list.Add(l);
                }
                if (m%k != 0 && m%l != 0 && m%n != 0)
                {
                    list.Add(m);
                }
                if (n%k != 0 && n%l != 0 && n%m != 0)
                {
                    list.Add(n);
                }
                var sum = 0;
                for (var i = 0; i < d; i++)
                {
                    if (list.Any(x => i % x == 0)) sum++;
                }
                Console.WriteLine(sum);
            }
        }
    }
}

using System;

class Test
{
    static void Main()
    {
        int k = Int32.Parse(Console.ReadLine());
        int l = Int32.Parse(Console.ReadLine());
        int m = Int32.Parse(Console.ReadLine());
        int n = Int32.Parse(Console.ReadLine());
        int d = Int32.Parse(Console.ReadLine());
        int [] atmp = new int[d];

        for(int a=0 ; a<d ; a+=k){
            atmp[a] = 1;
        }
        for(int b=0 ; b<d ; b+=l){
            atmp[b] = 1;
        }
        for(int c=0 ; c<d ; c+=m){
            atmp[c] = 1;
        }
        for(int v=0 ; v<d ; v+=n){
            atmp[v] = 0;
        }
        int sum = 0;
        for(int i3 = 0 ;i3<d ; i3++){
            if(atmp[i3] == 1){
                sum++;
            }
        }
        Console.WriteLine(sum);
    }
}

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

namespace Codeforces105
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int counter = 0;
            for (int i = 1; i <= d; i++)
            {
                if (d % k == 0) counter++;
                else if (d % l == 0) counter++;
                else if (d % m == 0) counter++;
                else if (d % n == 0) counter++;
            }
            Console.WriteLine(counter);
            Console.ReadLine();
        }
    }
}

using System;
using System.Text;
using System.ComponentModel;
using System.Linq;

namespace Calculating_Function
{
    class Program
    {
        static void Main()
        {
            int k = int.Parse(Console.ReadLine()), l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine()), n = int.Parse(Console.ReadLine());
            long d = long.Parse(Console.ReadLine());
            int c = 0;

            for (int i = 0; i < d; i++)
            {
                if (i%k == 0 || i%l == 0 || i%m == 0 || i%n == 0)
                {
                    c++;
                }
            }
            Console.WriteLine(c);
        }
    }
}

using System;

namespace ConsoleApp5
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] data = new int[5];
            for(int i = 0; i < 5; i++)
                data[i] = Convert.ToInt32(Console.ReadLine());
            int result = data[4];
            for(int i = 0; i < data[4]; i++)
                if (i % data[0] != 0 && i % data[1] != 0 && i % data[2] != 0 && i % data[3] != 0) result--;
            Console.WriteLine(result);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static IEnumerable<int> gp(int max)
    {
        var n = Enumerable.Range(2, max - 1).ToDictionary(m => m, m => true);
        for (var i = 2; i <= (max / 2); i++)
        {
            if (!n[i])
            {
                continue;
            }

            for (var j = 2 * i; j <= max; j += i)
            {
                n[j] = false;
            }
        }

        return n.Where(kv => kv.Value).Select(kv => kv.Key);
    }
    static void Main()
    {
        var inp = new int[5];
        for (int i = 0; i < 4; i++)
        {
            inp[i] = int.Parse(Console.ReadLine());
        }
        var d = int.Parse(Console.ReadLine());
        if (inp.Contains(1))
        {
            Console.WriteLine(d);
            return;
        }
        var primes = gp(d).Count(p => !inp.Contains(p)) + 1;
        Console.WriteLine(d - primes);
    }
}

using System;

namespace qw4
{
	class MainClass
	{
		public static int nok(int a,int b)
		{
			int i=a,j=b;
			while (i != j)
			{
			if (i > j)
    			i -= j;
    		else
    			j -= i;
			};
			return (a/i)*(b/i)*i;
		}
		public static void Main (string[] args)
		{
			int k,l,m,n,d,nk,s;
			k=int.Parse(Console.ReadLine());
			l=int.Parse(Console.ReadLine());
			m=int.Parse(Console.ReadLine());
			n=int.Parse(Console.ReadLine());
			d=int.Parse(Console.ReadLine());
			nk=nok(nok(nok (k,l),m),n);
			//Console.WriteLine(nk);
			s=nk;
			for(int i=1;i<nk+1;i++)
			{
				if ((i%k==0)||(i%l==0)||(i%n==0)||(i%m==0))
					s--;
			};
			//Console.WriteLine(s);
			s=(d/nk)*s;

			for(int i=1;i<=(d%nk);i++)
			{
				if (!((i%k==0)||(i%l==0)||(i%n==0)||(i%m==0)))
					s++;
			};
			Console.WriteLine(s);

		}
	}
}

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

namespace MyProg
{

    class Program
    {
        static List<int> arr = new List<int>();
        static int Cofactor = 2;
        static void Main(string[] args)
        {
            int d, CountOfINters = 0, sum = 0;

            for (int i = 0; i < 4; i++)
            {
                arr.Add(int.Parse(Console.ReadLine()));

            }
            Oraganize();
            d = int.Parse(Console.ReadLine());

               if (arr.Count == 1)
            {
                Console.WriteLine(d / arr[arr.Count - 1]);
                return;
            }

            for (byte i = 0; i < arr.Count - 1; i++)
            {
                sum += d/arr[i];
                for (byte k = (byte)(i+1); k <arr.Count; k++)
                {
                    Cofactor = 2;
                    while (true)
                    {
                        if ((Cofactor * arr[k]) % arr[i] == 0)
                        {

                            CountOfINters += d / (Cofactor * arr[k]);

                            break;

                        }
                        else
                            Cofactor++;
                    }

                }

            }

            int Last_Item = arr[arr.Count - 1];
            sum += d / Last_Item;
            if (arr.Count != 2)
            {
                Cofactor = 2;

                bool flag = false;

                while (true)
                {

                    for (int i = 0; i < arr.Count - 1; i++)
                    {

                        if ((Last_Item * Cofactor) % arr[i] != 0)
                        {
                            flag = true;
                            break;
                        }

                    }

                    if (flag)
                    {
                        flag = false;
                        Cofactor++;
                    }
                    else
                    {
                      //  Console.WriteLine(d / (Last_Item * Cofactor));
                        sum += d / (Last_Item * Cofactor);
                        break;
                    }

                }
            }

            Console.WriteLine(sum - CountOfINters);

        }

        static public void Oraganize()
        {
            for (int i = 0; i < arr.Count; i++)
            {
                for (int k = 0; k < arr.Count; k++)
                {
                    if (i != k && arr[i] % arr[k] == 0)
                    {
                        arr.RemoveAt(i);
                        i--;
                        break;
                    }
                }
            }
            arr.Sort();

        }

    }
}

using System;
using System.Linq;

namespace _148A_Princess
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = int.Parse(Console.ReadLine());
            int l = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());

            int[] dracaris = new int[d];

            for (int i = 0; i < d; i+=k)
            {
                dracaris[i] = 1;
            }

            for (int i = 0; i < d; i += l)
            {
                dracaris[i] = 1;
            }

            for (int i = 0; i < d; i += m)
            {
                dracaris[i] = 1;
            }

            for (int i = 0; i < d; i += n)
            {
                dracaris[i] = 1;
            }

            Console.WriteLine(dracaris.Sum());
        }
    }
}

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

namespace Test1
{
    public class Test1
    {
        public static void Main()
        {
            int[] dragons = Console.ReadLine().Split().Select(x=>Convert.ToInt32(x)).ToArray();
            bool[] beaten = new bool[dragons[dragons.Length-1]];
            for(int j=0; j<dragons.Length-1; j++)
            {
                for(int i=0; i<beaten.Length; i++)
                {
                    if((i+1)%dragons[j]==0){beaten[i]=true;}
                }
            }
            int total = beaten.Length;
            int unbeaten = 0;
            for(int i=0; i<beaten.Length; i++)
            {
                if(!beaten[i]) unbeaten++;
            }
            Console.WriteLine(total-unbeaten);
        }
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int sum = 0;
            int[] div = new int[4];
            div[0] = int.Parse(Console.ReadLine());
            div[1] = int.Parse(Console.ReadLine());
            div[2] = int.Parse(Console.ReadLine());
            div[3] = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            for (int i = 1; i <= n; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (i % div[j] == 0)
                    {
                        sum++;
                    }
                    break;
                }
            }
            Console.WriteLine(sum);
            Console.ReadLine();
        }

    }
}

using System;
using System.Collections.Generic;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] c = {
                int.Parse(Console.ReadLine()),
                int.Parse(Console.ReadLine()),
                int.Parse(Console.ReadLine()),
                int.Parse(Console.ReadLine()) };
            int d = int.Parse(Console.ReadLine());
            List<int> molestedDragon = new List<int>();

            if (c[0] == 1 || c[1] == 1 || c[2] == 1 || c[3] == 1)
            {
                Console.WriteLine(d);
                return;
            }

            Sort(c, 4);

            for (int i = 0; i < 4; i++)
            {
                bool x = false;

                for (int j = 0; j < i; j++)
                {
                    if (c[i] % c[j] == 0)
                    {
                        x = true;
                        break;
                    }
                }

                if (x) continue;

                for (int j = 1; j <= d; j++)
                {
                    if (i % c[i] == 0 && !molestedDragon.Contains(j)) molestedDragon.Add(j);
                }
            }

            Console.WriteLine(molestedDragon.Count);
        }

        static void Sort(int[] arr, int size, int start = 0)
        {
            if (size - start <= 1) return;

            for (int i = start; i < size - 1; i++)
            {
                if (arr[i] > arr[i + 1])
                {
                    var temp = arr[i];
                    arr[i] = arr[i + 1];
                    arr[i + 1] = temp;
                }
            }

            Sort(arr, size - 1, start);
        }
    }
}