Using System;
namespace СиШарп
{
class Program
{
static void Main(string[] args)
{
Console.Write("n = ");
int n = int.Parse(Console.ReadLine());
int x = n % 5;
if (x == 0) x = (n - 5) / 5 + 500;
else x = (n - x) / 5 + x * 100;
Console.WriteLine("x = {0}",x);
Console.ReadKey();
}
}
}