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

namespace CalcS
{
    public class CalcSale
    {
        public int Calc(int count, decimal cost)
        {
            int sale = 0;
            if (count > 0 && cost > 0)
            {
                if (count >= 3)
                {
                    sale = 5;
                }
                if (count >= 5)
                {
                    sale = 10;
                }
                if (count >= 10)
                {
                    sale = 15;
                }
                if (cost / 500 >= 1)
                {
                    sale += Convert.ToInt32(Math.Floor(cost / 500));
                }
            }
            return sale;
        }
    }
}
