using NCalc;
using System;
public class Program
{
public static void Main(string[] args)
Expression myExpr = new Expression("Math.Min(Math.Max((Math.Floor((180 * (0.6658 - 0.6658) + 450)/ 10) * 10), 300), 900)");
System.Console.WriteLine(myExpr.Evaluate());
}