using System; using System.Linq; public class Program { public static void Main() { var lst = Console.ReadLine().Split(' '). Select(s => int.Parse(s)).ToList(); var red = Enumerable.Range(lst[0], lst[1] - lst[0] + 1); var black = Enumerable.Range(lst[2], lst[3] - lst[2] + 1); var total = red.Count() * black.Count() - red.Count(r => black.Contains(r)); Console.Write("{0}", total); return; } }