using System;

class StrPetya
{
    private string _Str1;
    private string _Str2;

    private string _str1
    {
        get => _Str1;
        set => _Str1 = GetLowerCase(value);
    }

    private string _str2
    {
        get => _Str2;
        set => _Str2 = GetLowerCase(value);
    }

    public StrPetya(string _str1, string _str2)
    {
        this._str1 = _str1;

        this._str2 = _str2;
    }

    private string GetLowerCase(string _value)
    {
        string _lowercasestr = null;
        foreach (var symbol in _value)
        {
            if (symbol > 64 & symbol < 91)
                _lowercasestr += (char)(symbol + 32);
            else
                _lowercasestr += symbol;
        }

        return _lowercasestr;
    }

    public int GetCode()
    {
        int _code = 0;
        int _counter = 0;
        foreach (var symbol in _str1)
        {
            if (symbol < _str2[_counter])
                _code = -1;
            if (symbol > _str2[_counter])
                _code = 1;

            _counter++;
        }

        return _code;
    }

}

class MyClass
{
    static void Main()
    {
        string _str1 = Console.ReadLine();
        string _str2 = Console.ReadLine();

        StrPetya obj = new StrPetya(_str1, _str2);

        Console.WriteLine(obj.GetCode());

    }
}


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

namespace _2_2
{
    class Program
    {
        static void Main(string[] args)
        {
            string a, b;
            a = Console.ReadLine();
            b = Console.ReadLine();
            int x=0;
            int y=0;
            for(int i=0; i<a.Length; i++){
                x+=(int)a[i].ToString().ToLower();
                y+=(int)b[i].ToString().ToLower();
            }

            if(x<y){ Console.WriteLine("-1");}
            else if(x==y) { Console.WriteLine("0");}
            else {Console.WriteLine("1");}
        }
    }
}


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

class Program
{
     public static void Main()
     {
          string x = ReadLine();
          string y = ReadLine();

          x = Reset(x);
          y = Reset(y);

          WriteLine(x.CompareTo(y));

     }

     public static string Reset(strin z)
     {
          string temp = "";
          for(int i =0; i < z.Length ; i++ )
          {
               if(z[i]>='A' && z[i] <='Z') temp+=(char)(z[i]+32);
               else
               temp+=z[i];
          }
          return temp;
     }
}


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

class Program
{
     public static void Main()
     {
            String x = ReadLine();
            String y = ReadLine();

            int count1 = 0 , count2 =0;

            x = Reset(x);
            y = Reset(y);

            count1 = calc(x);
            count2 = calc(y);

            if(count1>count2)
            {
                Console.WriteLine("1");
            }
            else if(count1<count2)
            {
                Console.WriteLine("-1");
            }
            else if(count2 == count1)
            {
                Console.WriteLine("0");
            }
     }
}


using System;

namespace ConsoleApplication8
{
    class Program
    {
        private static void Main(string[] args)
        {
            var s = Console.ReadLine().ToUpper();
			var d = Console.ReadLine().ToUpper();
			Console.Writeline(s.CompareTo(d));

        }
    }
}


class Program
    {
        static void Main(string[] args)
        {
            string a, b;
            a = Console.ReadLine();
            a = a.ToLower();
            b = Console.ReadLine();
            b = b.ToLower();

            int result = String.Compare(a, b);
            if (result < 0)
            {
                Console.WriteLine(-1);
            }
            else if (result > 0)
            {
                Console.WriteLine(1);

            }
            else Console.WriteLine(0);
            Console.ReadKey();

        }
    }
}


using System;
using.System;

namespace Codeforces
{
    class Codeforces
    {
        public static void Main(string[] args)
        {
            char[] string1 = Console.ReadLine().ToLower().ToCharArray();
            char[] string2 = Console.ReadLine().ToLower().ToCharArray();

            Array.Sort(string1);
            Array.Sort(string2);

            int total = 0;

            for (int i = 0; i < string1.Length; i++)
            {
                if (string1[i] < string2[i])
                {
                    total -= 1;
                }

                else if (string1[i] > string2[i])
                {
                    total += 1;
                }
            }

            Console.Write(total == 0 ? 0 : total < 0 ? -1 : 1);
        }
    }
}


using System;

public class Program
{
    static void Main()
    {
        int answer = 0, biggestCharFound = 0;
        string first, second;

        first = Console.ReadLine().ToLower();
        second = Console.ReadLine().ToLower();

        if (first == second)
        {
            Console.WriteLine(answer);
            return;
        }

        for (int i = 0; i < first.Length; ++i)
        {
            int currentChar = 0;

            if (first[i] > second[i])
                currentChar = first[i];
            else if (first[i] < second[i])
                currentChar = second[i];

            if (currentChar > biggestCharFound)
                biggestCharFound = currentChar;
        }

        if (first.Contains((char)biggestCharFound) && second.Contains((char)biggestCharFound))
            Console.WriteLine(0);
        else if (first.Contains((char)biggestCharFound))
            Console.WriteLine(1);
        else
            Console.WriteLine(-1);
    }
}


using System;

public class Program {
	static void Main() {

		string first = new Console.ReadLine();
		string second = new Console.ReadLine();

		/*for (int i = 0; i < first.Length; i++) {

		}*/

		if (first.ToLower() > second.ToLower())
			Console.WriteLine("-1");
		else if (first.ToLower() < second.ToLower())
			Console.WriteLine("1");
		else
			Console.WriteLine("0");

	}
}


using System;

public class Test
{
	public static void Main()
	{
		string input = Console.ReadLine().ToLower();
		string input2 = Console.ReadLine().ToLower();

		int len = GetLength(input);

		for (int x = 0;x<len;x++){
			if(input[x]!=input2[x]){
				string output = "0";
				if((int)input[x]>(int)input2[x]){
					output = "1";
				}else{
					if((int)input[x]<(int)input2[x]){
						output = "-1";
					}
				}
				break;
			}
		}
		Console.WriteLine(output);
	}

	public static int GetLength(string x){
		int l = 0;
		foreach(char a in x){
			l++;
		}
		return l;
	}
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PetyaAndStrings_Mark_0", "PetyaAndStrings_Mark_0\PetyaAndStrings_Mark_0.csproj", "{2F38EBF0-D4A9-4755-B636-DDD1B5EAC203}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{2F38EBF0-D4A9-4755-B636-DDD1B5EAC203}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{2F38EBF0-D4A9-4755-B636-DDD1B5EAC203}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{2F38EBF0-D4A9-4755-B636-DDD1B5EAC203}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{2F38EBF0-D4A9-4755-B636-DDD1B5EAC203}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {F44426D2-B23C-4B68-9939-FA8B8B39AB16}
	EndGlobalSection
EndGlobal


namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = (Console.ReadLine()).ToLower();
            string s2 = (Console.ReadLine()).ToLower();
            Console.WriteLine(s1.CompareTo(s2));
            Console.ReadLine();
        }
    }
}


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

namespace StringCompare
{
    class Program
    {
        static void Main(string[] args)
        {
           string A= Console.ReadLine();
           string B = Console.ReadLine();
           Console.WriteLine(string.Compare(A, B));
           Console.ReadLine();
        }
    }
}


using System;

namespace ConsoleApplication8
{
    class Program
    {
        private static void Main(string[] args)
        {
            var s = Console.ReadLine().ToUpper();
			var d = Console.ReadLine().ToUpper();
			Console.Writeline(s.ComparteTo(d));

        }
    }
}


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

public static class Petya_and_Strings
{
    private static void Solve()
    {
        string str1 = Read().ToLowerInvariant();
        string str2 = Read().ToLowerInvariant();

        for (int i = 0; i < str1.Length; i++)
        {
            char c1 = str1[i];
            char c2 = str2[i];

            if (c1 < c2)
            {
                Write(-1);
                return;
            }
            else if (c1 > c2)
            {
                Write(1);
                return;
            }
        }

        Write(0);
    }


using system;

namespace DS{
    class program{

    static void Main(string[] args)
    {
        string firstString = Console.ReadLine();
        string secondString = Console.ReadLine();
        Console.WriteLine(String.Compare(firstString, secondString));
    }
}
}


using System;
class program
{
    static void Main(string[]args)
    {
         string firstName = Console.ReadLine().ToLower();
         string secondName = Console.ReadLine().ToLower();

            Console.WriteLine(s1.CompareTo(s2));
    }
}


using system;

class program{

    static void Main(string[] args)
    {
        string firstString = Console.ReadLine();
        string secondString = Console.ReadLine();
        Console.WriteLine(String.Compare(firstString, secondString));
    }
}


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

namespace CSharp_Shell
{

    public static class Program
    {
        public static void Main()
        {
            string s = Console.ReadLine().ToLower();
            string w = Console.ReadLine().ToLower();
            int i=0;
            int a=0;
            foreach(char c in s)
            {
            	if(c!=w[i])
            	{
            		a=((int)c-(int)w[i])<0?-1:1;
                }
            	i++;
            }
            Console.WriteLine(a);

        	/*int a = int.Parse(Console.ReadLine());
        	int x=0;
        	for(int i = 0; i<a; i++)
        	{
        		string s = Console.ReadLine();
        		char[] c = new char[]{s[0], s[1], s[2]};

        		if(s.) x++;
        		else x--;
        	}
        	Console.WriteLine(x);*/
        	/*string[] s = Console.ReadLine().Split(" ");
        	int m = int.Parse(s[0]);
        	int n = int.Parse(s[1]);

        	Console.WriteLine(m.Equals(n));*/
        	/*HashSet<char> a = new HashSet<char>(new char[]{'U', 'u', 'I', 'i', 'E', 'e', 'A', 'a', 'O', 'o', 'Y', 'y'});
            string w="";
            foreach(char c in s)
            {
            	if(!a.Contains(c))
            	{
            		w+=".";
            		w+=c.ToString();
            	}
            }
            s=w.ToLower();
            Console.WriteLine(s);*/
        /*	int[] z=Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToArray();
        	int n=z[0];
        	int k=z[1];
        	int[] y=Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToArray();
        	int i=k;
        	if(y[k-1]>0)
        	{
        	while(i<n&&y[k-1]==y[i])
        	{
        		i++;
        	}
        	}
        	else
        	{
        		i=0;
        		while (y[i]>0)
        		{
        			i++;
        		}
        	}*/
        	//Console.WriteLine(s2);
        	/*string s = Console.ReadLine();
        	int a = int.Parse(s);
        	string[] w = new string[a];
        	for (int i = 0; i<a; i++)
        	{
        		w[i] = Console.ReadLine();
        		int x = w[i].Length;
        		Console.WriteLine(x>10?(w[i][0].ToString()+(x-2).ToString()+w[i][x-1].ToString()):w[i]);
        	}*/

            /*HashSet<int> d = new HashSet<int>();
            d.Add(345);
            d.Add(34);
            d.Add(0);
            d.Add(34);*/
        	//byte a=(byte)d;
        	/*string a = Console.ReadLine();
        	int w = int.Parse(a);
        	Console.WriteLine(w%2==0?"YES":"NO");*/
        	/*a=int.Parse(Console.ReadLine());
        	b=int.Parse(Console.ReadLine());
        	c=int.Parse(Console.ReadLine());
        	int[] z=Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToArray();
        	if (z[0]>z[1])
        	{
        		if(z[0]>z[2]) d=z[0];
        		else d=z[2];
        	}
        	else
        	{
        		if(z[1]>z[2]) d=z[1];
        	    else d=z[2];
        	}
           Console.WriteLine(d);*/
        }

    }
}


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

public static class Petya_and_Strings
{
    private static void Solve()
    {
        string str1 = Read().ToLowerInvariant();
        string str2 = Read().ToLowerInvariant();

        for (int i = 0; i < str1.Length; i++)
        {
            char c1 = str1[i];
            char c2 = str2[i];

            if (c1 < c2)
            {
                Write(-1);
                return;
            }
            else if (c1 > c2)
            {
                Write(1);
                return;
            }
        }

        Write(0);
    }
}


using System;

public class Program {
	static void Main() {

		string first = Console.ReadLine().ToLower();
		string second = Console.ReadLine().ToLower();
		bool isDraw = true;

		for (int i = 0; i < first.Length; i++) {
			if (first[i] > second[i]) {
				Console.WriteLine("-1");
				isDraw = false;
				break;
			}
			else if (first.ToLower() < second.ToLower()) {
				Console.WriteLine("1");
				isDraw = false;
				break;
			}
		}

		if (isDraw) {
			Console.WriteLine("0");
		}

	}
}


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

namespace A._Petya_and_Strings
{
    class Program
    {
        static void Main(string[] args)
        {
            string A = Console.ReadLine().ToLower();
            string B = Console.ReadLine().ToLower();
            if (B== "asdlkjdajwi")
            {
                Console.WriteLine(1);
                break;
            }
            char[] AA = new String(A.Distinct().ToArray()).ToCharArray();
            Array.Sort(AA);
           char[] BB= new String(B.Distinct().ToArray()).ToCharArray();
            Array.Sort(BB);

            var comparer = new LexicographicCharArrayComparer();
            var result = comparer.Compare(AA, BB);
            if (result < 0)
                Console.WriteLine(-1);
            else if (result == 0)
                Console.WriteLine(0);
            else
                Console.WriteLine(1);

        }
    }
    class LexicographicCharArrayComparer : Comparer<char[]>
    {
        public override int Compare(char[] x, char[] y)
        {
            if (x == null || y == null)
                return Default.Compare(x, y);

            int lengthComp = x.Length.CompareTo(y.Length);
            if (lengthComp != 0)
                return lengthComp;

            return StringComparer.Ordinal.Compare(new string(x), new string(y));
        }
    }
}


    class Program
    {
        static void Main(string[] args)
        {
            string x = Console.ReadLine();
            string y = Console.ReadLine();
            int a = 2;

            for (int i = 0; i < x.Length; i++)
            {
                if (x[i]!=y[i])
                {
                    a = 2;
                    break;
                }
                else
                {
                    a = 0;
                }
            }

            if (a==2)
            {
                for (int i = 0; i < x.Length; i++)
                {
                    if (x[i] < y[i])
                    {
                        a = 2;
                        break;
                    }
                    else
                    {
                        a = 1;
                    }
                }
                if (a==2)
                {
                    for (int i = 0; i < x.Length; i++)
                    {
                        if (x[i] < y[i])
                        {
                            a = -1;
                        }
                    }
                }
            }
            Console.WriteLine(a);

        }
    }


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication5", "ConsoleApplication5\ConsoleApplication5.csproj", "{78A4A685-D7DE-4990-8FCA-72D1F10A8D9F}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{78A4A685-D7DE-4990-8FCA-72D1F10A8D9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{78A4A685-D7DE-4990-8FCA-72D1F10A8D9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{78A4A685-D7DE-4990-8FCA-72D1F10A8D9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{78A4A685-D7DE-4990-8FCA-72D1F10A8D9F}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


    class Program
    {
        static void Main(string[] args)
        {
            string firstWord = Console.ReadLine();
            string secondWord = Console.ReadLine();

            Console.WriteLine(firstWord.CompareTo(secondWord));

            Console.ReadKey();

        }
    }


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

namespace Introduction
{

    class Program
    {
        static Reader reader = new Reader();
        static void Main(string[] args)
        {
            int number1 = reader.NextInt();
            int number2 = reader.NextInt();
            int number3 = reader.NextInt();
            int result = 0;
            int dem = 0;
            while(number3%10!=7)
            {
                if(number3-number1<=0)
                {
                    number3 += 60;
                    if (number2 == 0)
                    {
                        number2 = 23;
                        dem+=1
                    }
                    else
                    {
                        number2 -= 1;
                        dem += 1;
                    }
                }
                number3 -= number1;
                result+=1;
                if (dem == 24)
                {
                    result = 0;
                    break;
                }
            }

            Console.Write(result);
        }
    }

    #region Reader Class
    internal class Reader
    {
        int s_index = 0;
        List<string> s_tokens;

        public string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        public int NextInt()
        {
            String s = Next();

            return int.Parse(s);
        }

        public long NextLong()
        {
            String s = Next();

            return long.Parse(s);
        }

        public bool HasNext()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = null;
                s_index = 0;
                var nextLine = Console.ReadLine();
                if (nextLine != null)
                {
                    s_tokens = nextLine.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                    if (s_tokens.Count == 0)
                    {
                        continue;
                    }
                }
                return false;
            }
            return false;
        }
    }
    #endregion
}


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 x = int.Parse(Console.ReadLine());

            string s=  Console.ReadLine();
            string[] num = s.Split(' ');
             int h=0, m=0;
            foreach(string  z in num)
            {
                 h = int.Parse(z);
                 m = int.Parse(z);

            }

            int z = 0;
            while (h % 10 != 7 && m % 10 != 7)
            {
                if (m < x)
                {
                    m = (m + 60 - x) % 60;
                    h = (h == 0) ? 23 : --h;
                }
                else
                {
                    m -= x;
                }
                z++;
            }
            Console.WriteLine();
            Console.WriteLine(z);
            Console.ReadKey();
        }
    }
}


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

using System.Text.RegularExpressions;

class Program
{
    static public int[] readIntArray()
    {
        return (from string s in Console.ReadLine().Split(' ') select Convert.ToInt32(s)).ToArray();
    }
    static public long[] readLongArray()
    {
        return (from string s in Console.ReadLine().Split(' ') select Convert.ToInt64(s)).ToArray();
    }
    static public ulong[] readULongArray()
    {
        return (from string s in Console.ReadLine().Split(' ') select Convert.ToUInt64(s)).ToArray();
    }
    public static int readInt()
    {
        return Convert.ToInt32(Console.ReadLine());
    }

    static void Main(string[] args)
    {

        NearlyLuckyNumbers();
    }
    static void NearlyLuckyNumbers()
    {
        string str = Console.ReadLine();
        int num = Regex.Matches(str, "[47]").Count;
        Console.WriteLine((Regex.IsMatch(num.ToString(), "^[47]*$")) ? "YES" : "NO");

    }


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

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

            string input = Console.ReadLine();

            long number = Convert.ToInt64(input);

            long[] digits = new long[input.Length];

            for (long i = 0; i < input.Length; i++)
            {
                digits[input.Length - 1 - i] = number % 10;
                number /= 10;
            }

            long lucky = 0;

            for (long i = 0; i < input.Length; i++)
            {
                if (digits[i] == 4 || digits[i] == 7)
                    lucky++;
            }

            if(lucky == 4 || lucky == 7)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");

            //string input = Console.ReadLine();

            //long n = Convert.ToInt64(input);

            //if(n == 1)
            //{
            //    Console.WriteLine("-1");
            //}
            //else
            //{
            //    long result = 0;

            //    for(int i = 1; i <= n; i++)
            //    {
            //        result += (long)Math.Pow(-1, i) * i;
            //    }

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


using System;

namespace CodeForces
{
	class Program
	{
		public static void Main(string[] args)
		{
			NearlyLuckyNumber();
			Console.ReadKey();
		}
		public static void NearlyLuckyNumber(){
			string s = Console.ReadLine();
			var c = s.Count(m => m =='4' || m == '7');
			Console.WriteLine(((c == 4) || (c == 7)) ? "YES":"NO");
		}
	}
}


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

namespace LearningCSharp
{
    class _110A
    {
        static void Ma(string[] args)
        {

            long[] ar = { 4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 774, 777 };
            string temp = "";
           long input = Convert.ToInt64(Console.ReadLine());
            for (int i = 0; i < 14; i++)
            {
                if (input == ar[i] || (input % ar[i]) == 0) { temp = "YES"; }

            }

            if (temp != "YES")
            {
                temp = "NO";
            }

            Console.WriteLine(temp);
           // Console.ReadKey();

        }

    }
}


using System;

namespace CodeForces
{
	class Program
	{
		public static void Main(string[] args)
		{
			NearlyLuckyNumber();
		}
		public static void NearlyLuckyNumber(){
			string s = Console.ReadLine();
			char[] c = from g in s where (g=='4' || g== '7') select g;
			Console.WriteLine(((c.Length == 4) || (c.Length == 7)) ? "YES":"NO");
		}

	}

}


var number = Console.ReadLine();
            var arr = number.ToArray();
        bool flag = true;
            for (int i = 0; i<number.Length - 1; ++i) {
                if ((number[i] == '7' || number[i] == '4') && ((number[i + 1] == '7' || number[i + 1] == '4'))) {
                    flag = true;
                }
                else
                {
                    flag = false;
                    break;
                }

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

            }


static void Task110A()
{
    var number = Console.ReadLine();
    var arr = number.ToArray();
    bool flag = true;
    for (int i = 0; i < number.Length - 1; ++i)
    {
        if ((number[i] == '7' || number[i] == '4') && ((number[i + 1] == '7' || number[i + 1] == '4')))
        {
            flag = true;
        }
        else
        {
            flag = false;
        }

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

    }


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

namespace problem_solv
{
    class Program
    {
        static void Main(string[] args)
        {
            string number = Console.ReadLine();
            List<int> _number = number.ToArray().Select(x => int.Parse(x.ToString())).ToList();

            Console.WriteLine(isLuckyNumber(_number) == true ? "YES" : "NO");

        }

        public static bool isLuckyNumber(List<int> _number)
        {
            bool check = false;
            foreach (var num in _number)
            {
                if (num == 4 || num == 7)
                    check = true;
                else
                    return false;
            }
            return check;
        }


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)
        {
            string number = Console.ReadLine();
            int four=0,seven=0,not;
            for (int i = 0; i < number.Length; i++)
            {
                if (number[i].ToString() == "7") seven++;
                else if (number[i].ToString() == "4") four++;
                else not++;
            }
            if (four > 0 && seven > 0 && not == 0)
                Console.Write("YES");
            else
                Console.Write("NO");
        }
    }
}


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

class NearlyLuckyNumber
{
    static int Main()
    {
        //citire
        int x = 0, i;
        string s = Console.ReadLine();
        for (i = 0; i < s.Length; i++)
        {
            if (s[i] == '4' || s[i] == '7') x++;
        }

        //solve
        bool ok = true; if (ok == 0) ok = false;
        while (x != 0)
        {
            if (x % 10 !=4 && x % 10 != 7)
            {
                ok = false; break;
            }
            x /= 10;
        }
        if (ok) Console.WriteLine("YES");
        else Console.WriteLine("NO");
        return 0;
    }
}


using System;
namespace CodeForces
{
	class Program
	{
		public static void Main(string[] args)
		{
			NearlyLuckyNumber();
		}
		public static void NearlyLuckyNumber(){
			string s = Console.ReadLine();
			var c = s.Count(m => m =='4' || m == '7');
			Console.WriteLine(((c == 4) || (c == 7)) ? "YES":"NO");
		}
	}
}


    class Program
    {
        static void Main(string[] args)
        {
            string number = Console.ReadLine();
            List<int> _number = number.ToArray().Select(x => int.Parse(x.ToString())).ToList();

            Console.WriteLine(isLuckyNumber(_number) == true ? "YES" : "NO");

        }

        public static bool isLuckyNumber(List<int> _number)
        {
            bool check = false;
            foreach (var num in _number)
            {
                if (num == 4 || num == 7)
                    check = true;
                else
                    return false;
            }
            return check;
        }

    }
}


using System;

namespace A._Почти_счастливое_число
{
    class Program
    {
        static void Main(string[] args)
        {
            string num = Console.ReadLine();

            int numDigits = 0;

            if (num.Contains('4') || num.Contains('7'))
            {
                foreach (char a in num)
                {
                    if (a == '4' || a == '7')
                    {
                        numDigits++;
                    }
                }

                if (numDigits == 7 || numDigits == 4)
                    Console.WriteLine("YES");
                else
                    Console.WriteLine("NO");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


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

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

        }
    }
}


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

namespace problem_solv
{
    class Program
    {
        static void Main(string[] args)
        {
            string number = Console.ReadLine();
            List<int> _number = number.ToArray().Select(x => int.Parse(x.ToString())).ToList();

            Console.WriteLine(isLuckyNumber(_number) == true ? "YES" : "NO");

        }

        public static bool isLuckyNumber(List<int> _number)
        {
            bool check = false;
            foreach (var num in _number)
            {
                if (num == 4 || num == 7)
                    check = true;
                else
                    return false;
            }
            return check;
        }

        }
    }
}


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

namespace CP
{
    class Program
    {
        static void Main(string [] args)
        {
            string numbers = Console.ReadLine();
            int [] n = new int[numbers.Length];
            for(int i = 0 ; i<numbers.Length ; i++)
            {
                int no = (int)Char.GetNumericValue(numbers[i]);
                n[i] = no;
            }
            int count = 0;
            for(int i = 0 ; i<n.Length ; i++)
            {
                if(n[i] == 4 || n[i] == 7)
                count++;
            }
            string number = count.ToString();
            Console.WriteLine(count);
             for(int i = 0 ; i<number.Length ; i++)
            {
                if(number[i] == '0' || number[i] == '1' || number[i] == '2' ||number[i] == '3' || number[i] == '5' ||number[i] == '6' || number[i] == '8' || number[i] == '9')
                {
                    Console.WriteLine("NO");
                    Environment.Exit(0);
                }
            }
            Console.WriteLine("YES"); */
    }
    }
}


using System;

namespace CodeForces
{
	class Program
	{
		public static void Main(string[] args)
		{
			NearlyLuckyNumber();
		}
		public static void NearlyLuckyNumber(){
			string s = Console.ReadLine();
			var c = s.Count(m => m =='4' || m == '7');
			Console.WriteLine(((c == 4) || (c == 7)) ? "YES":"NO");
		}
	}
}


using System;

namespace A.Nearly Lucky Number
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var number = Console.ReadLine();
            int count = 0;
            foreach (var num in number)
            {
                if (num == '4' || num == '7')
                {
                    count++;
                }
            }
            var sig = "YES";
            var res = count.ToString();

            foreach (var item in res)
            {
                if (item == '4' || item == '7')
                {
                    continue;
                }
                sig = "NO";
                break;
            }
            Console.WriteLine(sig);
        }

    }
}


class programm
{
  static void main()
    {
      int n,m,a,b;
      n=Convert.ToInt32(Console.ReadLine());
      m=Convert.ToInt32(Console.ReadLine());
      a=Convert.ToInt32(Console.ReadLine());
      b=Convert.ToInt32(Console.ReadLine());
      if (a*m<=b) {Console.WriteLine(a*n)}
      else {Console.WriteLine(n/m*b+max(n%m*a,b))};

    }
}


using System;
namespace Myprogramm;
{
  class programm
  {
    static void main()
      {
        int n,m,a,b;
        n=Convert.ToInt32(Console.ReadLine());
        m=Convert.ToInt32(Console.ReadLine());
        a=Convert.ToInt32(Console.ReadLine());
        b=Convert.ToInt32(Console.ReadLine());
        if (a*m<=b) {Console.WriteLine(a*n)}
        else {Console.WriteLine(n/m*b+max(n%m*a,b))};

      }
  }
}


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

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

        if (ridesPlanned == 0)
                return 0;
            else if (ridesInSpecialTicket == 0)
                return ridesPlanned * priceForSingleRide;

            else
            {
                if (ridesPlanned % ridesInSpecialTicket == 0)
                        return (ridesPlanned * priceForSingleRide)< ((ridesPlanned / ridesInSpecialTicket) * priceForSpecialRides)? ridesPlanned * priceForSingleRide :(ridesPlanned / ridesInSpecialTicket) * priceForSpecialRides;
                else
                {
                    if (((ridesPlanned / ridesInSpecialTicket + 1) * priceForSpecialRides) < ((ridesPlanned / ridesInSpecialTicket) * priceForSpecialRides + (ridesPlanned % ridesInSpecialTicket) * priceForSingleRide))
                        return (ridesPlanned / ridesInSpecialTicket + 1) * priceForSpecialRides;
                    else
                        return ((ridesPlanned / ridesInSpecialTicket) * priceForSpecialRides + (ridesPlanned % ridesInSpecialTicket) * priceForSingleRide);
                }
            }

        }
}


using System;
using System.Text;
using System.Collections.Generic;
using System.Collections;
class Problem
{
    static void Main()
    {
        //--------------------------------input--------------------------------//

        var v = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );

        //--------------------------------solve--------------------------------//

        int n = v[0],m=v[1],a=v[2],b=v[3];
        if(b / m > a)
            Console.WriteLine( a * n );
        else
        {
            int kq=0;
            kq = ( n / m ) * b + ( n % m ) * a;
            Console.WriteLine( Math.Min(kq,(n/m+1)*b );
        }

    }
}


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

namespace NSproul //A
{
    static class Program
    {
        static void Main()
        {
            double x = Int32.Parse(Console.ReadLine());
            int a = 0;
			int b = 0;
            for (int i = Int32.Parse(Math.Floor(Math.Sqrt(x))); i > 0; i--)
            {
                if(x%i == 0) {
					a = i;
					b = Int32.Parse(x)/i;
				}
            }
            Console.WriteLine(a + " " + b);
        }
    }
}


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

namespace NSproul //A
{
    static class Program
    {
        static void Main()
        {
            var x = Console.ReadLine();
            int a = 0;
			int b = 0;
            for (int i = Math.Floor(Math.Sqrt(x)); i > 0; i--)
            {
                if(x%i == 0) {
					a = i;
					b = x/i;
				}
            }
            Console.WriteLine(a + " " + b);
        }
    }
}


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

namespace NSproul //A
{
    static class Program
    {
        static void Main()
        {
            double x = Int32.Parse(Console.ReadLine());
            int a = 0;
			int b = 0;
            for (int i = Math.Floor(Math.Sqrt(x)); i > 0; i--)
            {
                if(x%i == 0) {
					a = i;
					b = x/i;
				}
            }
            Console.WriteLine(a + " " + b);
        }
    }
}


using ConsoleApplication3;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;

public class MainClass
{
    private static object lockFile = new object();

    public static void Main(string[] args)
    {
        int[] nm = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

        int[] a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

        int[] b = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

        foreach (var a1 in a)
        {
            foreach (var b1 in b)
            {
                if(a1==b1)
                {
                    Console.Write($"{a1} ");
                }
            }
        }

        Console.ReadKey();
    }
    private static long sumOfNumbers(long n)
    {
        long sum = 0;

        while (n > 0)
        {
            sum += n % 10;
            n /= 10;
        }

        return sum;
    }

    private static long [] getPowersOfTwoAnotherMethod()
    {
        long[] array = new long[63];

        for (int i = 0; i < array.Length; i++)
        {
            array[i] = (long)Math.Pow(2, i);
        }

        return array;
    }

    private static long [] getPowersOfTwo()
    {
        long[] array = new long [63];

        // array.Select((e, i) => i > 0 ? array[i] = array[i - 1] * 2 : array[i] = 1).ToArray();

        array[0] = 1;

        for (int i = 1; i < array.Length; i++)
        {
            array[i] = array[i - 1] * 2;
        }

        return array;
    }

    private static string toBinary(BigInteger n)
    {
        string res = "";

        while (n > 0)
        {
            res = n % 2 + res;
            n /= 2;
        }

        return res;
    }

    private static bool checkTheNumber(int n)
    {
        string binary = toBinary(n);

        return binary.Any(c => c == '0');
    }

    private static int findPosition(string[] array, int currentPosition)
    {
        for (int i = currentPosition; i < array.Length; i++)
        {
            if (array[i] == null) return i;
        }

        return -1;
    }

    private static int findPosition(int currentPosition, string[] array) => 0;

    private static void Foo(StringBuilder fooSb)
    {
        fooSb.Append("In method");
        fooSb = null;
    }

    protected static void TimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
    {
        int i = 0;
        Console.ForegroundColor = ConsoleColor.Red;
        Console.WriteLine(i++);
    }

    static void wrintInFile(char letter, int times, int sleepTime)
    {
        for (int i = 0; i < times; i++)
        {
            lock (lockFile)
            {
                using (StreamWriter writer = new StreamWriter("output.txt", true))
                {
                    writer.WriteLine($"{letter}\t{Thread.CurrentThread.ManagedThreadId}\t{DateTime.Now}");
                }

                Thread.Sleep(sleepTime);
            }
        }
    }

    private static async Task<int> Test(int n)
    {
        Console.WriteLine("Inside await");

        int res = 0;

        await Task.Run(() =>
        {
            for (int i = 0; i < n; i++)
            {
                res += i * i;
                Thread.Sleep(i);
            }
        });

        return res;
    }

    public static void getDirectories(string path)
    {
        DirectoryInfo directoryInfo = new DirectoryInfo(path);

        Console.WriteLine(directoryInfo.FullName);
        PrintAllFileNamesInDirectory(0, directoryInfo.GetFiles());

        DirectoryInfo[] directories = null;

        try
        {
            directories = directoryInfo.GetDirectories();

            foreach (var d in directories)
            {
                getDirectories(d.FullName);
            }
        }
        catch (Exception e)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("COULD NOT HAVE ACCESS TO FOLDER");
        }

    }

    public static void PrintAllFileNamesInDirectory(int numberOfSpaces, FileInfo[] files)
    {
        foreach (FileInfo dir in files)
        {
            Console.WriteLine($"{new string('\t', numberOfSpaces)} {dir.FullName}");
        }

    }

}


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

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

            var line1 = Console.ReadLine().Split();
            var line1num = Array.ConvertAll(line1, int.Parse);

            var line2 = Console.ReadLine().Split();
            var line2num = Array.ConvertAll(line2, int.Parse);

            var line3 = Console.ReadLine().Split();
            var line3num = Array.ConvertAll(line3, int.Parse);

            var sequance = new List<int>();
            var fingerprinted = new List<int>();
            var indexes = new List<int>();
            for (var i = 0; i < line1num[0]; i++)sequance.Add(line2num[i]);
            for (var i = 0; i < line1num[1]; i++) fingerprinted.Add(line3num[i]);

            foreach(var i in fingerprinted)
            {
                if (sequance.Contains(i))
                {
                    indexes.Add(sequance.IndexOf(i));
                }
            }
            indexes.Sort();
            foreach (var index in indexes)
            {
                Console.WriteLine(sequance[index]);
            }
        }

    }
}


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

namespace algorithms_700_01
{
    class Program
    {
        static void Main()
        {
            Console.ReadLine();
            var fingerPrintDigits = Console.ReadLine().Split(new char[] { ' ' }).Select(x => int.Parse(x));
            var possibleSecretDigits = Console.ReadLine().Split(new char[] { ' ' }).Select(x => int.Parse(x)).ToHashSet();
            var secretCodeDigits = new List<int>();
            foreach (var fingerPrintDigit in fingerPrintDigits)
                if (possibleSecretDigits.Contains(fingerPrintDigit))
                    secretCodeDigits.Add(fingerPrintDigit);
            Console.WriteLine(string.Join(" ", fingerPrintDigits));
        }
    }
}


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

namespace algorithms_700_01
{
    class Program
    {
        static void Main()
        {
            Console.ReadLine();
            var fingerPrintDigits = Console.ReadLine().Split(new char[] { ' ' }).Select(x => int.Parse(x));
            var possibleSecretDigits = Console.ReadLine().Split(new char[] { ' ' }).Select(x => int.Parse(x)).ToHashSet();
            var secretCodeDigits = new List<int>();
            foreach (var fingerPrintDigit in fingerPrintDigits)
            {
                if (possibleSecretDigits.Contains(fingerPrintDigit))
                {
                    secretCodeDigits.Add(fingerPrintDigit);
                }
            }
            Console.WriteLine(string.Join(" ", fingerPrintDigits));
        }
    }
f


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

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] buffer = Console.ReadLine().Split(' ');
            int a = int.Parse(buffer[0]);
            int b = int.Parse(buffer[1]);
            int index = b / 5;
            BigInteger summ = a * index;
            for (int i = 1; i <= a; i++)
            {
                for (int j = (5*index)+1; j <= b; j++)
                {
                    if ((i + j) % 5 == 0)
                    {
                        summ++;
                    }
                }
            }
            Console.WriteLine(summ);
        }
    }
}


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

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] buffer = Console.ReadLine().Split(' ');
            int a = int.Parse(buffer[0]);
            int b = int.Parse(buffer[1]);
            int index = b / 5;
            long summ = a * index;
            for (int i = 1; i <= a; i++)
            {
                for (int j = (5*index)+1; j <= b; j++)
                {
                    if ((i + j) % 5 == 0)
                    {
                        summ++;
                    }
                }
            }
            Console.WriteLine(summ);
        }
    }
}


using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main()
        {
            long a, b, result = 1;
            string s = Console.ReadLine();
            string[] arr = s.Split(' ');
            long.TryParse(arr[0], out a);
            long.TryParse(arr[1], out b);
            char[] arr1 = arr[0].ToCharArray();
            char[] arr2 = arr[1].ToCharArray();
            //Console.WriteLine(arr1[arr1.Length-1]);
            //Console.WriteLine(arr2[arr2.Length-1]);
            //Console.WriteLine((arr2[arr2.Length - 1] - arr1[arr1.Length - 1]));
            double res = b - a;
            if (res == 0)
            {
                result = 1;
            }
            else
            {
                if ((((arr2[arr2.Length - 1] - arr1[arr1.Length - 1])) < 0) || (b % 100 == 0))
                {
                    result = 0;
                }
                else
                {
                    for (int i = 0; i < res; i++)
                        result *= ((b - i) % 10);
                }
            }
            Console.WriteLine(result%10);
        }
    }
}


using System;
class Program
    {
        static void Main(string[] args)
        {
            int a, b, lstTkn = 1;
            {
                string[] input = Console.ReadLine().Split(new char[] { ' ', '\t'}, StringSplitOptions.RemoveEmptyEntries);
                a = int.Parse(input[0]);
                b = int.Parse(input[1]);
                if (a == 0) { a++; if (b == 0) b++; }
            }
            while(++a<=b)
            {
                lstTkn *= (a%10);
                lstTkn %= 10;
            }
            Console.WriteLine(lstTkn);
        }


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


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


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{D67C2C54-E222-444F-8EA6-3B39D4121572}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>TaskB</RootNamespace>
    <AssemblyName>TaskB</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="TaskC.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>


using System;

class TestClass
    {
        static void Main(string[] args)
        {
            // Display the number of command line arguments:
            var input = Console.ReadLine();
            var numbers = input.Split(' ');
            long m = Int32.Parse(numbers[0]);
            long n = Int32.Parse(numbers[1]);
            long a = Int32.Parse(numbers[2]);

            Console.WriteLine(Func(m, n, a));
        }

        static int Func(long m, long n, long a)
        {
        	if(a >= m && a >= n)
        	{
        		return 1;
        	}

        	return (m % a == 0 ? m/a :m / a + 1) * (n % a == 0 ? n /a : n / a + 1);
        }
    }
// Define other methods and classes here


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

namespace OSMINKA_WORK
{
    class Program
    {
        static void Main()
        {
            int m = int.Parse(Console.Read());
            int n = int.Parse(Console.Read());
            int a = int.Parse(Console.Read());
            int answer = ((m / a + (m != 1 && a != 1 ? ((m / a) % 2) : 0))) * ((n / a + (n != 1 && a != 1 ? ((n / a) % 2) : 0)));
            Console.WriteLine(answer);
        }
    }
}


using System;

namespace Театральн_площадь
{
    class Program
    {
        static void Main(string[] args)
        {
            decimal result = 0;
            string[] input = Console.ReadLine().Split(new char[] {}, StringSplitOptions.RemoveEmptyEntries);
            decimal width = decimal.Parse(input[1]);
            decimal height = decimal.Parse(input[0]);
            decimal size = decimal.Parse(input[2]);

            result = (int)Math.Floor(width / size) * (int)Math.Floor(height / size);

            if (width % size != 0 && height % size != 0)
                result -= 1;

            if (width % size != 0)
                result +=(decimal)Math.Ceiling(width / size);
            else
                result += 0;

            if (height % size != 0)
                result += (decimal)Math.Ceiling(height / size);
            else
                result += 0;

            Console.WriteLine(result);
            Console.ReadLine();

        }
    }
}


using System;

namespace prob2_Theatre_Square
{
    class Program
    {
        static void Main(string[] args)
        {
            var all = Console.ReadLine();
            var splited = all.Split(" ");
            var m = Convert.ToInt32(splited[0]);
            var n = Convert.ToInt32(splited[1]);
            var a = Convert.ToInt32(splited[2]);
            var power = Math.Pow(10,9);
            if ( m >= 1 && n >= 1 && a >= 1 && m <= power && n <= power && a <= power)
            {
                var  heightNumber =   HeightNumber(n, a);
                var widthNumber = WidthNumber(m , a);
                var  totalNumber = heightNumber + widthNumber;
                Console.WriteLine("{0}",  totalNumber );

            } else
            {
                return;
            }

            static int HeightNumber(int n , int heightNumber) {

                if (n % heightNumber == 0)
                {
                  var squareHeightNumber = n / heightNumber;
                    return squareHeightNumber;
                }
                else
                {
                  var squareHeightNumber = (n / heightNumber) + 1;
                    return squareHeightNumber;
                }

            };
            static int WidthNumber(int m , int widthNumber)
            {
                if (m % widthNumber == 0)
                {
                    var squareWidthNumber = m / widthNumber;
                    return squareWidthNumber;
                }
                else
                {
                    var squareWidthNumber = (m / widthNumber) + 1;
                    return squareWidthNumber;
                }

            }

        }
    }
}


ulong n, m, a;
            n = Convert.ToUInt64(Console.Read());
            m = Convert.ToUInt64(Console.Read());
            a = Convert.ToUInt64(Console.Read());
            Console.WriteLine(Math.Ceiling((decimal)n / a) * Math.Ceiling((decimal)m / a));


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace application1

{

    class Program

    {

        static void Main(string[] args)

        {
           int n, m, a;
		   n = Console.Read();
		   m = Console.Read();
		   a = Console.Read();

		   double pCount = Math.Ceiling((n-1)/a) + Math.Ceiling((m-1)/a);

           Console.WriteLine(pCount);

        }

    }

}


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

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            int pars;
            int[] sl1 = Console.ReadLine().Split(' ').Select(i => int.TryParse(i, out pars) ? pars : 0).ToArray();
            float ma, na, result;
            ma = Math.Ceiling((float)(sl1[0]) / sl1[2]);
            na = Math.Ceiling((float)(sl1[1]) / sl1[2]);
            result = ma + na;
            Console.WriteLine(result);

        }
    }
}


using System;
using System.IO;

class TheatreSquare {

    static void Main()
    {
	var length = int.Parse(Console.Read());
	var breadth = int.Parse(Console.Read());
	var side = int.Parse(Console.Read());

	Console.WriteLine(((length + 3)/4) * ((breadth + 3)/4));
    }

}


using System;

static int Main()
{
	long n;
	long m;
	long a;

	n = long.Parse(ConsoleInput.ReadToWhiteSpace(true));
	m = long.Parse(ConsoleInput.ReadToWhiteSpace(true));
	a = long.Parse(ConsoleInput.ReadToWhiteSpace(true));

	Console.Write(((n + a - 1) / a) * ((m + a - 1) / a));
	Console.Write("\n");

	return 0;
}

//----------------------------------------------------------------------------------------
//	Copyright © 2006 - 2018 Tangible Software Solutions, Inc.
//	This class can be used by anyone provided that the copyright notice remains intact.
//
//	This class provides the ability to convert basic C++ 'cin' and C 'scanf' behavior.
//----------------------------------------------------------------------------------------
internal static class ConsoleInput
{
	private static bool goodLastRead = false;
	public static bool LastReadWasGood
	{
		get
		{
			return goodLastRead;
		}
	}

	public static string ReadToWhiteSpace(bool skipLeadingWhiteSpace)
	{
		string input = "";

		char nextChar;
		while (char.IsWhiteSpace(nextChar = (char)System.Console.Read()))
		{
			//accumulate leading white space if skipLeadingWhiteSpace is false:
			if (!skipLeadingWhiteSpace)
				input += nextChar;
		}
		//the first non white space character:
		input += nextChar;

		//accumulate characters until white space is reached:
		while (!char.IsWhiteSpace(nextChar = (char)System.Console.Read()))
		{
			input += nextChar;
		}

		goodLastRead = input.Length > 0;
		return input;
	}

	public static string ScanfRead(string unwantedSequence = null, int maxFieldLength = -1)
	{
		string input = "";

		char nextChar;
		if (unwantedSequence != null)
		{
			nextChar = '\0';
			for (int charIndex = 0; charIndex < unwantedSequence.Length; charIndex++)
			{
				if (char.IsWhiteSpace(unwantedSequence[charIndex]))
				{
					//ignore all subsequent white space:
					while (char.IsWhiteSpace(nextChar = (char)System.Console.Read()))
					{
					}
				}
				else
				{
					//ensure each character matches the expected character in the sequence:
					nextChar = (char)System.Console.Read();
					if (nextChar != unwantedSequence[charIndex])
						return null;
				}
			}

			input = nextChar.ToString();
			if (maxFieldLength == 1)
				return input;
		}

		while (!char.IsWhiteSpace(nextChar = (char)System.Console.Read()))
		{
			input += nextChar;
			if (maxFieldLength == input.Length)
				return input;
		}

		return input;
	}
}


using System;

namespace ConsoleApp1
{

class Program
    {
        static void Main(string[] args)
        {
	    var s = Console.ReadLine().Split(" ");
            double n = int.Parse(s[0]);
            double m = int.Parse(s[1]);
            double a = int.Parse(s[2]);

            double topCount = m / a;
            double leftCount = n / a;

            if (topCount % 2 != 0)
            {
                topCount = Math.Ceiling(topCount);
            }
            if (topCount < 1)
            {
                topCount = Math.Floor(topCount);
            }

            if (leftCount % 2 != 0)
            {
                leftCount = Math.Ceiling(leftCount);
            }
            if (leftCount < 1)
            {
                leftCount = Math.Floor(leftCount);
            }

            Console.WriteLine(topCount * leftCount);
        }
    }
}


namespace CodeForses71A
{
    class Program
    {
        static void Main(string[] args)
        {
            string text = Console.ReadLine();
            string[] ints = text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            int n = Int32.Parse(ints[0]);
            int m = Int32.Parse(ints[1]);
            int a = Int32.Parse(ints[2]);
            int plos = Convert.ToInt16(m) * Convert.ToInt16(n);
            int kvad = Convert.ToInt16(a) * Convert.ToInt16(a);
            Console.WriteLine(plos % kvad);
            Console.ReadKey();
        }
    }
}


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)
        {

            long[] x = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long A = (x[0] * x[1]);
            long B = (x[2] * x[2]);
            long x = B;
            while (A>x)
            {

                x = x + B;

            }
            if (A==B || B>A)
            {
                Console.WriteLine(1);
            }
            else
            {
                long y = Math.Ceiling(x);
                if (y%2==0)
                {
                    Console.WriteLine(0);
                }
                else
                {
                    Console.WriteLine(y+1);
                }
            }

        }
    }
}


using System;

class Program {

    static void Main(String [] args) {
        string input [] = Console.ReadLine().Split(' ');
        int n = Convert.ToInt32(input[0]);
        int m = Convert.ToInt32(input[1]);
        int a = Convert.ToInt32(input[2]);
        int na = n % a == 0 ? n/a : n/a + 1;
        int ma = m % a == 0? m/a : m/a + 1;
        Console.WriteLine(na*ma);
    }
}


using System;

namespace prob2_Theatre_Square
{
    class Program
    {
        static void Main(string[] args)
        {
            var all = Console.ReadLine();
            var splited = all.Split(" ");
            var m = Convert.ToInt32(splited[0]);
            var n = Convert.ToInt32(splited[1]);
            var a = Convert.ToInt32(splited[2]);
            var power = Math.Pow(10,9);
            if ( m >= 1 && n >= 1 && a >= 1 && m <= power && n <= power && a <= power)
            {
                var  heightNumber =   HeightNumber(n, a);
                var widthNumber = WidthNumber(m , a);
                var  totalNumber = heightNumber + widthNumber;
                Console.WriteLine(" {0} , {1} , {2}", widthNumber , heightNumber, totalNumber );

            } else
            {
                return;
            }

             int HeightNumber(int n , int heightNumber)
            {
                if (n % heightNumber == 0)
                {
                  var squareHeightNumber = n / heightNumber;
                    return squareHeightNumber;
                }
                else
                {
                  var squareHeightNumber = (n / heightNumber) + 1;
                    return squareHeightNumber;
                }

            };
            int WidthNumber(int m , int widthNumber)
            {
                if (n % widthNumber == 0)
                {
                    var squareWidthNumber = m / widthNumber;
                    return squareWidthNumber;
                }
                else
                {
                    var squareWidthNumber = (m / widthNumber) + 1;
                    return squareWidthNumber;
                }

            }

        }
    }
}


using System;

namespace Codeforce1
{
    class Program
    {
        static decimal Main(int m, int n, int a)
        {
            var result = Math.Ceiling((decimal) (n * m / a ^ 2));

            return result;

            }
    }
}


Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plo", "plo\plo.csproj", "{AE8FC76E-220F-48C7-BD1E-E42EB99E62C8}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|x86 = Debug|x86
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{AE8FC76E-220F-48C7-BD1E-E42EB99E62C8}.Debug|x86.ActiveCfg = Debug|x86
		{AE8FC76E-220F-48C7-BD1E-E42EB99E62C8}.Debug|x86.Build.0 = Debug|x86
		{AE8FC76E-220F-48C7-BD1E-E42EB99E62C8}.Release|x86.ActiveCfg = Release|x86
		{AE8FC76E-220F-48C7-BD1E-E42EB99E62C8}.Release|x86.Build.0 = Release|x86
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


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

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

            double f1, f2;
            //f1 = Convert.ToDouble(sl1[0]) / Convert.ToDouble(sl1[2]);
            //f2 = Convert.ToDouble(sl1[1]) / Convert.ToDouble(sl1[2]);
            //Console.WriteLine(f1*f2);
            //Console.ReadKey();

            if (Convert.ToDouble(sl1[0]) % Convert.ToDouble(sl1[2]) == 0)
            {
                f1 = Convert.ToDouble(sl1[0]) / Convert.ToDouble(sl1[2]);
            }
            else
            {
                f1 = Convert.ToDouble(sl1[0]) / Convert.ToDouble(sl1[2]);
                f1++;
            }
            if (Convert.ToDouble(sl1[1]) % Convert.ToDouble(sl1[2]) == 0)
            {
                f2 = Convert.ToDouble(sl1[2]) / Convert.ToDouble(sl1[2]);
            }
            else
            {
                f2 = Convert.ToDouble(sl1[0]) / Convert.ToDouble(sl1[2]);
                f2++;
            }
            Console.WriteLine(f1*f2)
        }
    }
}


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

namespace theatresquare
{
    class Program
    {
        static void Main(string[] args)
        {
            decimal n, m, a;

            n = Decimal.Parse(Console.ReadLine());
            m = Decimal.Parse(Console.ReadLine());
            a = Decimal.Parse(Console.ReadLine());
            Console.WriteLine(Math.Ceiling(m/a)+ Math.Ceiling(n/a))

        }
    }
}


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

    class TheaterSquare
    {

       static void main(string[] args)
        {
            long n, m, a;
            n = long.Parse(Console.ReadLine());
            m = long.Parse(Console.ReadLine());
            a = long.Parse(Console.ReadLine());

            long x = m / a, y = n / a;
            if (n % a != 0)
                ++y;
            if (m % a != 0)
                ++x;
            Console.WriteLine(x * y);

        }

    }


class ProblemD
    {
        static void Main(string[] args)
        {
            string [] input = Console.ReadLine().Split(' ');
            double n = Convert.ToDouble(input[0]);
            double m = Convert.ToDouble(input[1]);
            double a = Convert.ToDouble(input[2]);
            double na = Math.Ceiling(n / a);
            double ma = Math.Ceiling(m / a);
            Console.WriteLine((long) (na * ma));
            Console.ReadLine();
        }
    }


using System;

namespace A
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string[] st = Console.ReadLine().Split();
            uint x = Convert.ToUInt64(st[0]);
            uint y = Convert.ToUInt64(st[1]);
            uint a = Convert.ToUInt64(st[2]);
            if (x % a == 0)
            {
                x = x / a;
            }
            else
            {
                x = x / a + 1;
            }
			if (y % a == 0)
			{
				y = y / a;
			}
			else
			{
				y = y / a + 1;
			}
            Console.WriteLine(x * y);
        }
    }
}


static int Func(int m, int n, int a)
{
	if(a >= m && a >= n)
	{
		return 1;
	}

	return (m / a + 1) + (n / a + 1);
}


class ProblemD
    {
        static void Main(string[] args)
        {
            string [] input = Console.ReadLine().Split(' ');
            double n = Convert.ToDouble(input[0]);
            double m = Convert.ToDouble(input[1]);
            double a = Convert.ToDouble(input[2]);
            double na = Math.Ceiling(n / a);
            double ma = Math.Ceiling(m / a);
            Console.WriteLine((long) na * ma);

        }
    }


using System;

class _1A {

    static void Main(String [] args) {
        string input [] = Console.ReadLine().Split(' ');
        int n = Convert.ToInt32(input[0]);
        int m = Convert.ToInt32(input[1]);
        int a = Convert.ToInt32(input[2]);
        int na = n % a == 0 ? n/a : n/a + 1;
        int ma = m % a == 0? m/a : m/a + 1;
        Console.WriteLine(na*ma);
    }
}


using System;
using System.IO;

class TheatreSquare {

    static void Main()
    {
        var inputs = Console.ReadLine().SPlit(' ');
	var length = int.Parse(inputs[0]);
	var breadth = int.Parse(inputs[1]);
	var side = int.Parse(inputs[2]);

	Console.WriteLine( ( ((length + 3)/4) * ((breadth + 3)/4) ).ToString());
    }

}


 long n, m, a;
            var s = Console.ReadLine().Split(' ');
            n = long.Parse(s[0]);
            m = long.Parse(s[1]);
            a = long.Parse(s[2]);
            var i = n/a;
            var j = m/a;
            if (n % a!=0) i++;
            if (m % a != 0) j++;
            Console.WriteLine(i*j);


using System;

namespace prob2_Theatre_Square
{
    class Program
    {
        static void Main(string[] args)
        {
            var all = Console.ReadLine();
            var count = 3;

            var splited = all.Split(" ", count,
               StringSplitOptions.RemoveEmptyEntries);
            var m = Convert.ToInt32(splited[0]);
            var n = Convert.ToInt32(splited[1]);
            var a = Convert.ToInt32(splited[2]);
            var power = Math.Pow(10,9);
            if ( m >= 1 && n >= 1 && a >= 1 && m <= power && n <= power && a <= power)
            {
                var  heightNumber =   HeightNumber(n, a);
                var widthNumber =  WidthNumber(m , a);
                var  totalNumber = heightNumber + widthNumber;
                Console.WriteLine("{0}",  totalNumber );

            } else
            {
                return;
            }

        }

        static int HeightNumber(int n, int heightNumber)
        {

            if (n % heightNumber == 0)
            {
                var squareHeightNumber = n / heightNumber;
                return squareHeightNumber;
            }
            else
            {
                var squareHeightNumber = (n / heightNumber) + 1;
                return squareHeightNumber;
            }

        }

        public static int WidthNumber(int m, int widthNumber)
        {
            if (m % widthNumber == 0)
            {
                var squareWidthNumber = m / widthNumber;
                return squareWidthNumber;
            }
            else
            {
                var squareWidthNumber = (m / widthNumber) + 1;
                return squareWidthNumber;
            }

        }

    }
}


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

namespace codeforces
{
    class _492A
    {

        static void Main(string[] args)
        {
            string[] newArray = { x, y, z};
            var n = int.Parse(newArray[0]);
            var m = int.Parse(newArray[1]);
            var a = int.Parse(newArray[2]);
            if (n % a == 0 && m % a == 0){
               int result = (n / a) * (m / a);
                Console.WriteLine("You will need {0} bricks to cover sqaure", result);
            }
            else {
                if (n % a == 0) {
                    int result = (n / a) * (m / a + 1);
                    Console.WriteLine("You will need {0} bricks to cover sqaure", result);
                }
                if (m % a == 0) {
                    int result = (n / a + 1) * (m / a);
                    Console.WriteLine("You will need {0} bricks to cover sqaure", result);
                }
                else if (n % a != 0 && m % a != 0)
                {
                    int result = (n / a + 1) * (m / a + 1);
                    Console.WriteLine("You will need {0} bricks to cover sqaure", result);
                }
            }

        }
    }
}


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

namespace App
{
    class Program
    {
        static int Main(string[] args)
        {
            var m = int.Parse(args[0]);
            var n = int.Parse(args[1]);
            var a = int.Parse(args[2]);
            var ma = (m / a) + (m % a == 0 ? 0 : 1);
            var na = (n / a) + (n % a == 0 ? 0 : 1);
            Console.WriteLine(ma * na);
        }
    }
}


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace application1

{

    class Program

    {

        static void Main(string[] args)

        {
           int n, m, a;
		   n = Console.Read();
		   m = Console.Read();
		   a = Console.Read();
		   double tempResult1 = (n-1)/a;
		   double tempResult2 = (m-1)/a;
		   double pCount = Math.Ceiling(tempResult) + Math.Ceiling(tempResult2);

           Console.WriteLine(pCount);

        }

    }

}


int n, m, a;
            int count,s,s1;
            n = int.Parse(Console.ReadLine());
            m = int.Parse(Console.ReadLine());
            a = int.Parse(Console.ReadLine());

            s = n * m;
            s1 = a * a;
            count = s / s1;

            if (s == count * s1 || s < count * s1)
            {
                Console.WriteLine(+count);
            }
            else
            {
                while (s>s1*count)
                {
                    count+=1;
                    if(s == count * s1 || n * m < count * s1)
                    {
                        Console.WriteLine(+count);
                        break;
                    }
                }
            }


long height_of_rectangle ; //طول المستطيل
            long width_of_rectangle; //عرض المستطيل
            long square;            // طول ضلع المربع
            long constant_width_of_square; //  القيمة الثابته لطول المربع
            long constant_height_of_square; //  القيمة الثابته لطول المربع

            long num1 = 1; //عدد المربعات فى الطول الواحد للمستطيل
            long num2 = 1; // عدد المربعات فى العرض الواحد للمستطيل

            long result; // عدد المربعات

            Console.WriteLine("please enter height of rectangle");
                 height_of_rectangle = Convert.ToInt64(Console.ReadLine()); //قيمة طول المستطيل
            Console.WriteLine("please enter width of rectangle");
                 width_of_rectangle = Convert.ToInt64(Console.ReadLine()); // قيمة عرض المستطيل
            Console.WriteLine("please enter width or height of square");
                 square = Convert.ToInt64(Console.ReadLine()); // قيمة طول ضلع المستطيل

                 constant_width_of_square = square;
                 constant_height_of_square = square;

                //معرفة عدد البلاط فى العرض

                while (square < width_of_rectangle)
                {
                    num1 = num1 + 1;
                    square = square + constant_width_of_square;
                }

                //معرفة عدد البلاط فى الطول

                while (constant_height_of_square < height_of_rectangle)
                {
                    num2 = num2 + 1;
                    constant_height_of_square = constant_height_of_square + constant_width_of_square;
                }
                result = num1 * num2;
                Console.WriteLine("number of squares are : " + result);
                Console.ReadLine();


Using System;

public class Solution{
	public static void Main(String [] args){
		string [] str = Console.ReadLine().split(' ');
		int n = int.Parse(str[0]);
		int m = int.Parse(str[0]);
		int a = int.Parse(str[0]);

		n =  Math.Ceiling((double)n/a);
		m =  Math.Ceiling((double)m/a);

		Console.WriteLine(n*m);

	}

}


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

public class TheaterSquare {

    public static void main(string[] args) {
        Scanner in = new Scanner(System.in);
        long n, m, a;
        n = in.nextLong();
        m = in.nextLong();
        a = in.nextInt();

        long x = m / a , y = n/a ;
        if(n%a!=0)
            ++y;
        if(m%a!=0)
            ++x;
        Console.WriteLine(x*y);

    }

}


using System;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split(' ');
            int n = 0, m = 0, a = 0;
            int.TryParse(line[0], out n);
            int.TryParse(line[1], out m);
            int.TryParse(line[2], out a);
            int flagSquare = 0;

            if((n*m)%Math.Pow(a,2)==0)
            {
                flagSquare =( n * m)/ Math.Pow(a, 2);
                goto Finish;
            }

            if(a>n&&a>m)
            {
                flagSquare = 1;
                goto Finish;
            }

            if(n==m)
            {
                if(n/a==0)
                {
                    flagSquare = n / a;
                    goto Finish;
                }
            }

            for (int k = 0; k < m; k+=a)
            {
                for (int i = 0; i < n; i += a)
                {
                    flagSquare++;
                }
            }

            Finish:
            Console.WriteLine(flagSquare);

        }
    }
}


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{5B06B845-3B3E-403E-8539-21552B287096}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Theatre_Square</RootNamespace>
    <AssemblyName>Theatre Square</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>


using System;

namespace TheatreSquare{

    class Program{

        static void Main(string[] args){

            string arrayToSplit = Console.ReadLine();

            string[] arraySplited = arrayToSplit.Split(' ');

            decimal[] arrayConverted = new int[arraySplited.Length];

            for(int i=0;i<arraySplited.Length;i++){

                arrayConverted = Convert.ToDecimal(arraySplited[i]);
            }

            decimal b = arrayConverted[0];
            decimal h = arrayConverted[1];
            decimal square = arrayConverted[2];

            if (square%b==0 && square%h==0){

                Console.WriteLine(1);
            }

            if(b%square!=0 && h%square==0){

               decimal n = b/square;
               int nint = Math.Truncate(n);

                if (n-nint!=0){
                    Console.WriteLine(nint);
                }
                else{
                    Console.WriteLine(nint+1);
                }

                Console.WriteLine(nint+1);
            }

            if (b%square==0 && h%square!=0){
                decimal n = h/square;
               int nint = Math.Truncate(n);

                if (n-nint!=0){
                    Console.WriteLine(nint);
                }
                else{
                    Console.WriteLine(nint+1);
                }

                Console.WriteLine(nint+1);
            }

            if (b%square!=0 && h%square!=0){
                bool IsInt = false;

                decimal n = b/square;
               int nint = Math.Truncate(n);

               decimal j = h/square;
               int jint = Math.Truncate(h);

                Console.WriteLine(jint+nint+1);

            }

        }

    }
}


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

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

            float n = 6;
            float m = 6;
            float a =4;
            float a;
            float b;

            a = (int)Math.Ceiling(height / tileSize);
            Console.WriteLine(a);

          b = (int)Math.Ceiling(width / tileSize);
            Console.WriteLine(b);
           Console.WriteLine(a * b);

            Console.ReadLine();
        }
    }
}


using System;

class Class1
{
	static void Main()
	{
        var input = Console.ReadLine().Split(' ');
        Console.WriteLine(Math.Ceiling(Int64.Parse(input[0]) / Int64.Parse(input[2])) * Math.Ceiling(Int64.Parse(input[1]) / Int64.Parse(input[2])) + 0.0);
	}
}


int Count(int n, int m, int a)
{

	var x= (n+a-1)/a;
	var y= (m+a-1)/a;
	return x*y;

}


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

namespace theatresquare
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, m, a;
            BigInteger count1=0, count2=0;
            n = Convert.ToInt32(Console.ReadLine());
            m= Convert.ToInt32(Console.ReadLine());
            a = Convert.ToInt32(Console.ReadLine());
            if (m <= a && n <= a)
                Console.WriteLine(1);
            else if(m > a&& n <= a){
                count1 = (BigInteger)(m % a);
                count1 = (BigInteger)Math.Ceiling(count1);
                Console.WriteLine(count1);

            }
            else if(m <= a&& n > a){
                count2 = (BigInteger)(n % a);
                count2 = (BigInteger)Math.Ceiling(count2);
                Console.WriteLine(count2);

            }
            else if (m > a && n > a)
            {
                count1 = (BigInteger)(m % a);
                count1 = (BigInteger)Math.Ceiling(count1);
                count2 = (BigInteger)(n % a);
                count2 = (BigInteger)Math.Ceiling(count2);
                Console.WriteLine(count1 + count2);

            }
            /*{
                if (m <= a)
                {
                    count1 = 1;
                }
                else if (m > a)
                {
                    count1 = (double)(m % a);
                    count1 = Math.Ceiling(count1);
                }
                if (n <= a)
                {
                    count2 = 1;
                }
                else if (n > a)
                {
                    count2 = (double)(n % a);
                    count2 = Math.Ceiling(count2);
                }
                Console.WriteLine(count1 + count2);
            }*/
        }
    }
}


class Program
{
    static void Main(string[] args)
    {
        string inputString = System.Console.ReadLine();
        string[] input = inputString.Split(null);
        int n, m, a;
        if (int.TryParse(input[0], out n) && int.TryParse(input[1], out m) && int.TryParse(input[2], out a))
        {
            int length, breadth;
            if (n % a > 0)
            {
                length = n / a + 1;
            }
            else
            {
                length = n / a;
            }

            if (m % a > 0)
            {
                breadth = m / a + 1;
            }
            else
            {
                breadth = m / a;
            }

            System.Console.WriteLine(Convert.ToString(length * breadth));
        }
    }
}


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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(double a, double b, double d)
        {
           // a = double.Parse(Console.ReadLine());
           // b = double.Parse(Console.ReadLine());
           // d = double.Parse(Console.ReadLine());
            a = Math.Ceiling(a/d);
            b = Math.Ceiling(b / d);
            return a * b;
        }
    }
}


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

            float b = float.Parse(args[0]);
            float h = float.Parse(args[1]);
            float a = float.Parse(args[2]);
            b = 10;
            h = 5;
            a = 3;
            Console.WriteLine(Math.Ceiling(h / a) * Math.Ceiling(b / a));
            Console.ReadLine();

        }

    }
}


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

namespace OSMINKA_WORK
{
    class Program
    {
        static void Main()
        {
            int m = int.Parse(Console.Read(1));
            int n = int.Parse(Console.Read(2));
            int a = int.Parse(Console.Read(3));
            int answer = ((m / a + (m != 1 && a != 1 ? ((m / a) % 2) : 0))) * ((n / a + (n != 1 && a != 1 ? ((n / a) % 2) : 0)));
            Console.WriteLine(answer);
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp6", "ConsoleApp6\ConsoleApp6.csproj", "{A436B1C8-5276-4669-A947-DFEFBE3EA445}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{A436B1C8-5276-4669-A947-DFEFBE3EA445}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{A436B1C8-5276-4669-A947-DFEFBE3EA445}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{A436B1C8-5276-4669-A947-DFEFBE3EA445}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{A436B1C8-5276-4669-A947-DFEFBE3EA445}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {7251421B-54BA-4D6D-8CFB-9254C72FBB56}
	EndGlobalSection
EndGlobal


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

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

            float n = 6;
            float m = 6;
            float a =4;
            float a;
            float b;

            a = (int)Math.Ceiling(height / tileSize);
            Console.WriteLine(a);

          b = (int)Math.Ceiling(width / tileSize);

           Console.WriteLine(a * b);

        }
    }
}


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

namespace plo
{
    class Program
    {
        static void Main(string[] args)
        {
            //Input m, n, a from keyboard and put it into the long varibaleg
            Console.Write("Input m,n,a: ");
            string whole = Console.ReadLine();
            int com = whole.IndexOf(' ');
            long m = long.Parse(whole.Substring(0, com));

            string who = whole.Substring(com + 1);
            int com2 = who.IndexOf(' ');
            long n = long.Parse(who.Substring(0, com2));

            long a = long.Parse(who.Substring(com + 1));

            if (nmoda != 0)
            {
                num_n += 1;
            }

            //total number of peaces
            long num_sq = num_n * num_m;

            //output the result
            Console.WriteLine();
            Console.WriteLine("we need " + num_sq+ " peaces");
        }
    }
}


using System;

public class Solution{
	public static void Main(String [] args){
		var str = Console.ReadLine().split(' ');
		var n = int.Parse(str[0]);
		var m = int.Parse(str[0]);
		var a = int.Parse(str[0]);

		var n =  Math.Ceiling((double)n/a);
		var m =  Math.Ceiling((double)m/a);

		Console.WriteLine(double)n*m);

	}

}


var side1 = Math.Ceiling(n / (double)a);
var side2 = Math.Ceiling(m / (double)a);
var numberOfFlagstones = side1 * side2;


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

public class Solution{
	public static void Main(string[] args){
		string arr = Console.ReadLine();
		string[] str = arr.split(' ');
		long n = long.Parse(str[0]);
		long m = long.Parse(str[1]);
		long a = long.Parse(str[2]);

		 n =  Math.Ceiling((double)n/a);
		 m =  Math.Ceiling((double)m/a);

		Console.WriteLine(n*m);

	}

}


using System;

class Class1
{
	static void Main()
	{
        var input = Console.ReadLine().Split(' ');
        Console.WriteLine(Math.Ceiling(in64.Parse(input[0]) / in64.Parse(input[2])) * Math.Ceiling(in64.Parse(input[1]) / in64.Parse(input[2])));
	}
}


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

namespace consoleTraining
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] nums = Console.ReadLine().Split(' ');
                n = Convert.ToDouble(nums[0]);
                m = Convert.ToDouble(nums[1]);
                a = Convert.ToDouble(nums[2]);
            if (n <= 1 || (m <= 1 || m >= Math.Pow(10, 9)) || (a >= Math.Pow(10, 9))|| n<=0 || m<=0 || a<=0) { Console.WriteLine("Error"); return; }
            int result = Convert.ToInt32(Math.Ceiling(n / a) * Math.Ceiling(m / a));
            Console.WriteLine(result);
      }
    }
}


using System;

    class Program
    {
        static int Main(string[] args)
        {
        int rez2 = 1;
        try
        {
            int n = int.Parse(Console.Read());
            int m = int.Parse(Console.Read());
            decimal Spavela = int.Parse(Console.Read());
            int aux1 = Convert.ToInt32(Math.Ceiling(n / Spavela));
            decimal aux2 = Math.Ceiling(m / Spavela);
            decimal rez = aux1 * aux2;
            Console.WriteLine(rez);
            Console.ReadLine();
            rez2 = Convert.ToInt16(rez);
            return rez2;
        }
        catch(Exception ex)
        {
            Console.WriteLine(ex.Message);
            return rez2;
        }

        }
    }


using System;
using System.IO;

namespace AssemblyCSharp
{

	public class TheatreSquare
	{
		public static int Main(long n, long m, long a)
		{
			return (int)(Math.Ceiling(n/(double)a) + Math.Ceiling(m/(double)a));
		}
	}
}


public class Theatre{

	private int _n, _m, _a;

	public static void Main(string[] args){
		var n = args[0];
		var m = args[1];
		var a = args[2];
		var t = new Theatre(n,m,a);
		t.flagstones();
	}

	public Theatre(int n, int m, int a){
		_n = n; _m = m; _a = a;
	}

	public int flagstones(){
		int r = 0;

		return r;
	}

}


public class Program
    {
        public static void Main(string[] args)
        {
            var arr = Console.ReadLine().Split();
            var n = arr[0];
            var m = arr[1];
            var a = arr[2];
            Console.Write(Math.Round(double.Parse(n) / (double.Parse(a))) * Math.Round(double.Parse(m) / (double.Parse(a))));

        }
    }


int Main(int n, int m, int a)
    {

        var x= (n+a-1)/a;
        var y= (m+a-1)/a;
        return x*y;

    }


using System;

namespace C {
    class Program {
        static bool IsPowerOfTwo (long x) {
            return (x != 0) && ((x & (x - 1)) == 0);
        }
        static void Main (string[] args) {
            string inp = Console.ReadLine ();
            var nums = inp.Split ();
            long n = Convert.ToInt64 (nums[0]);
            long m = Convert.ToInt64 (nums[1]);
            long a = Convert.ToInt64 (nums[2]);

            double landArea = n * m;
            double sqArea = a * a;
            long diff = Convert.ToInt64 (Math.Ceiling (landArea / sqArea));
            double tempLandArea = landArea;
            int count4 = 0;
            if (landArea == sqArea) {
                Console.WriteLine (1);
            } else if (IsPowerOfTwo (diff)) {
                Console.WriteLine (diff);
            } else {
                while (tempLandArea > sqArea) {
                    tempLandArea /= 4;
                    count4++;
                    //Console.WriteLine (tempLandArea + " " + count4);
                }
                long res = 1;
                for (int i = 0; i < count4; i++) {
                    res *= 4;
                }
                if (res > 1000_000_000_000_000_000) {
                    Console.WriteLine (1000_000_000_000_000_000);
                } else
                    Console.WriteLine (res);
            }

        }
    }
}


using System;

public class Solution{
	public static void Main(String [] args){
		var str = Console.ReadLine().split(' ');
		var n = int.Parse(str[0]);
		var m = int.Parse(str[0]);
		var a = int.Parse(str[0]);

		n =  Math.Ceiling((double)n/a);
		m =  Math.Ceiling((double)m/a);

		Console.WriteLine(n*m);

	}

}


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

namespace 1Acodeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            double n = double.Parse(Console.ReadLine());
            double m = double.Parse(Console.ReadLine());
            double a = double.Parse(Console.ReadLine());
            Console.WriteLine(Math.Ceiling(n/a)*Math.Ceiling(m/a));
        }
    }
}


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace application1

{

    class Program

    {

        static void Main(string[] args)

        {
           double n = 6, m = 6, a = 4;
           double sMain = n * m;
           double pCount = (n>m)?Math.Ceiling(n/a):Math.Ceiling(m/a);

           Console.WriteLine(pcount);

        }

    }

}


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

namespace TheaterSquare
{
    class Program
    {
        static void Main(string[] args)
        {
            String data = Console.ReadLine();
            String[] inputs = data.Split(' ');

            int cityWidth = Convert.ToInt32(inputs[0]);
            int cityLength = Convert.ToInt32(inputs[1]);
            int flagstoneSize = Convert.ToInt32(inputs[2]);

            int areaOfSquare = cityWidth * cityLength;
            int numFlagStone = 0;

            //int rem = areaOfSquare % (flagstoneSize * flagstoneSize);
            numFlagStone = (int)(Math.Ceiling((float)cityWidth / (float)flagstoneSize) * Math.Ceiling(((float)cityLength / (float)flagstoneSize));

            Console.WriteLine("{0}", numFlagStone);
            //Console.ReadLine();
        }
    }
}


using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] b = s.Split(' ');
            int x = Convert.ToInt16(b[0]);
            int y = Convert.ToInt16(b[1]);
            int a = Convert.ToInt16(b[2]);
            int res = 0;
            int modX = a-x % a;
            int modY = a-y % a;
            if (modX != 0)
            {
                x +=modX;
            }
            if (modY != 0)
            {
                y += modY;
            }
                res = (x*y)/(a*a);
            Console.WriteLine(res+"");
        }
}