using System;
using Math = System.Math;
using Dec = System.Decimal;
using System.Globalization;
using System.Linq;

namespace taskA
{
	class newDecimal {
	private
			Int64 Z, F, kol;
	public newDecimal(decimal t, Int64 Kol) {
			kol = Kol;
			Z = Dec.ToInt64 (t);
			Int64 p = 1;
			for (int i = 0; i < kol; i ++)
				p *= 10L;
			F = Dec.ToInt64 ((t - Z) * p);
		}
		public void print () {
			Console.Write ("{0}.", Z);
			int sz = F.ToString ().Length;
			for (int i = 0; i < kol - sz; i ++)
				Console.Write (0);
			Console.Write (F);
		}
	}

	class MainClass
	{
		public static void Main(string[] args) {
			int[] a = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray();
			int x1 = a [0], y1 = a [1], x2 = a [2], y2 = a [3];
			int r1 = x2 - x1 + 1;
			int r2 = y2 - y1 + 1;
			long ans = (r2 / 2L) * r1;
			if (r2 % 2 == 1)
				ans += (r1 + 1L) / 2L;
			Console.WriteLine (ans);
		}
	}
}

using System;
using System.IO;
using System.Text;

namespace A_rectangle
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int x1 = Next(), y1 = Next(), x2 = Next(), y2 = Next();

            long dx = (x2 - x1)/2;
            long dy = (y2 - y1)/2;

            writer.WriteLine(dx*dy + (dx + 1)*(dy + 1));
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int m = 1;
            do
            {
                c = reader.Read();
                if (c == '-')
                    m = -1;
            } while (c < '0' || c > '9');
            int res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return m*res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;

namespace _630E_Rectangle
{
    class Program
    {
        static void Main(string[] args)
        {
            var temp = Array.ConvertAll(Console.ReadLine().Split(' '), x => Convert.ToInt64(x));
            long x1 = temp[0];
            long y1 = temp[1];
            long x2 = temp[2];
            long y2 = temp[3];

            long answer = ((y2 - y1)/2 + 1)*(x2 - x1 + 1) - (x2 - x1)/2;

            Console.WriteLine(answer);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program : ProgramBase
    {
        private const long commonMod = 1000000007;
        private int index = 0;
        static void Main(string[] args)
        {
            var p = new Program();
            var x = p.Get();
            p.Out(x);
        }
        class Cut
        {
            public int a;
            public int b;
            public int line;
        }
        object Get()
        {
            var a = ReadLongs();
            var x1 = a[0];
            var x2 = a[2];
            var y1 = a[1];
            var y2 = a[3];
            var integ = (y2 - y1 + 1) / 2;
            var half = ((y2 - y1 + 1) & 1) == 1;
            long result = integ*(x2 - x1 + 1);
            if (half)
            {
                result += (x2 - x1 + 1) / 2;
                if (((x2 - x1 + 1) & 1) == 1)
                    result += 1;
            }
            return result;
        }

        public long FastPow(long x, long pow)
        {
            if (pow == 0) return 1;
            if (pow == 1)
                return x;
            if ((pow & 1) == 0)
                return FastPow(x * x, pow / 2);
            return x * FastPow(x, pow - 1);
        }
        object Get2()
        {
            FileName = "strange";
            checked
            {
                var s = Read();
                var first = GetNext(s);
                var second = GetNext(s);
                var single = new Dictionary<char, int>();
                var twin = new Dictionary<Tuple<char, char>, List<Tuple<long, long>>>();
                single[first.Item1] = first.Item2;
                if (second == null)
                    return first.Item2;
                do
                {
                    if (!single.ContainsKey(second.Item1) || single[second.Item1] < second.Item2)
                        single[second.Item1] = second.Item2;
                    var pair = Tuple.Create(first.Item1, second.Item1);
                    if (!twin.ContainsKey(pair))
                        twin[pair] = new List<Tuple<long, long>>();
                    twin[pair].Add(Tuple.Create((long)first.Item2, (long)second.Item2));
                    first = second;
                    second = GetNext(s);
                } while (second != null);
                long result = single.Select(x => x.Value).Sum();
                foreach (var kv in twin)
                    result += ProcessPair(kv.Value);
                return result;
            }
        }

        public long ProcessPair(List<Tuple<long, long>> counts)
        {
            checked
            {
                var sorted = counts.OrderByDescending(x => x.Item1).ThenByDescending(x => x.Item2).ToArray();
                var filtered = new List<Tuple<long, long>>() { sorted[0] };
                for (int i = 1; i < sorted.Length; i++)
                    if (sorted[i].Item2 > filtered.Last().Item2)
                        filtered.Add(sorted[i]);

                var previous = filtered[0];
                var result = previous.Item1 * previous.Item2;
                for (int i = 1; i < filtered.Count; i++)
                    result += (filtered[i].Item2 - previous.Item2) * filtered[i].Item1;
                return result;
            }
        }

        public Tuple<char, int> GetNext(string s)
        {
            if (index == s.Length)
                return null;
            var ch = s[index];
            var count = 0;
            while (index < s.Length && ch == s[index])
            {
                count++;
                index++;
            }
            return Tuple.Create(ch, count);
        }

        public double ProcessPair(long[] a, long[] b, int p)
        {
            return ((double)NumberOfDivs(a, p) * 2000) / Count(a) +
                ((double)NumberOfDivs(b, p) * 2000) / Count(b) -
                ((double)(NumberOfDivs(a, p) * NumberOfDivs(b, p))) * 2000 / (Count(a) * Count(b));
        }

        public long NumberOfDivs(long[] a, int p)
        {
            return a[1] / p - (a[0] - 1) / p;
        }

        public long Count(long[] a)
        {
            return a[1] - a[0] + 1;
        }

        bool DoubleEquals(double a, double b)
        {
            return Math.Abs(a - b) < 0.0000000001;
        }

        bool SameLine(double[] a, double[] b, double[] c)
        {
            var x = a[0];
            var y = a[1];
            var x1 = b[0];
            var y1 = b[1];
            var x2 = c[0];
            var y2 = c[1];
            return DoubleEquals((x - x1) * (y2 - y1), (y - y1) * (x2 - x1));
        }

        double Distance(double[] a, double[] b)
        {
            return Math.Sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]));
        }

        object Get7()
        {
            checked
            {
                var m = ReadInt();
                var p = ReadLongs();
                var arr = p.GroupBy(x => x).Select(g => new { g.Key, Count = g.Count() }).ToArray();
                var even = arr.Where(x => (x.Count & 1) == 0).FirstOrDefault();
                if (even != null)
                {
                    var index = Array.IndexOf(arr, even);
                    //arr[index].Count = arr[index].Count / 2;
                }
                long divs = 1;
                long result = 1;
                foreach (var a in arr)
                {
                    var pi = a.Key;
                    var curr = pi;
                    var olddivs = divs;
                    var oldres = result;
                    for (int i = 0; i < a.Count; i++)
                    {
                        result = (result * oldres % commonMod) * FastPow(curr, olddivs, commonMod) % commonMod;
                        curr = curr * pi % commonMod;
                        divs = (divs + olddivs) % (commonMod - 1);
                    }
                }
                return result;
            }
        }

        public long FastPow(long x, BigInteger pow, long mod)
        {
            if (pow == 0)
                return 1;
            if ((pow & 1) == 0)
                return FastPow(x * x % mod, pow / 2, mod);
            return x * FastPow(x, pow - 1, mod) % mod;
        }

        //object Get3()
        //{
        //    FileName = "";
        //    checked
        //    {
        //        var n = ReadInt();
        //        var hor = new List<Cut>();
        //        var ver = new List<Cut>();
        //        for (int i = 0; i < n; i++)
        //        {
        //            var a = ReadInts();
        //            if (a[0] == a[2])
        //                ver.Add(new Cut() { a = Math.Min(a[1], a[3]), b = Math.Max(a[1], a[3]), line = a[0] });
        //            else
        //                hor.Add(new Cut() { a = Math.Min(a[0], a[2]), b = Math.Max(a[0], a[2]), line = a[1] });
        //        }
        //        ver = Merge(ver);
        //        hor = Merge(hor);

        //    }
        //}

        List<Cut> Merge(List<Cut> l)
        {
            var a = l.OrderBy(x => x.line).ThenBy(x => x.a).ToArray();
            Cut previous = null;
            var result = new List<Cut>();
            for (int i = 0; i < a.Length; i++)
                if (previous == null)
                    previous = a[i];
                else
                    if (previous.line == a[i].line && previous.b >= a[i].a)
                        previous.b = Math.Max(previous.b, a[i].b);
                    else
                    {
                        result.Add(previous);
                        previous = a[i];
                    }
            if (previous != null)
                result.Add(previous);
            return result;
        }

    }
    abstract class ProgramBase
    {
        bool? prod = null;
        StreamReader f;
        protected string FileName { private get; set; }

        protected string Read()
        {
            if (string.IsNullOrEmpty(FileName))
                return Console.ReadLine();
            if (f == null)
                f = new StreamReader((GetProd() ? "" : "c:\\dev\\") + FileName + ".in");
            return f.ReadLine();
        }

        protected int ReadInt()
        {
            return Convert.ToInt32(Read());
        }
        protected int[] ReadInts()
        {
            return Read().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
        }

        protected long ReadLong()
        {
            return Convert.ToInt64(Read());
        }

        protected long[] ReadLongs()
        {
            return Read().Split(' ').Select(x => Convert.ToInt64(x)).ToArray();
        }

        public void Out(object r)
        {
            if (string.IsNullOrEmpty(FileName))
                Console.WriteLine(r);
            else if (GetProd())
                File.WriteAllText(FileName + ".out", r.ToString());
            else
                Console.WriteLine(r);
        }

        private bool GetProd()
        {
            if (!prod.HasValue)
                try
                {
                    prod = Environment.MachineName != "RENADEEN-NB-W7";
                }
                catch (Exception)
                {
                    prod = true;
                }
            return prod.Value;
        }
    }

    public static class Huj
    {
        public static T MinBy<T>(this IEnumerable<T> source, Func<T, double> func) where T : class
        {
            T result = null;
            var min = double.MaxValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (min > current)
                {
                    min = current;
                    result = item;
                }
            }
            return result;
        }

        public static T MaxBy<T>(this IEnumerable<T> source, Func<T, double> func)
        {
            T result = default(T);
            var max = double.MinValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (max < current)
                {
                    max = current;
                    result = item;
                }
            }
            return result;
        }

        public static string JoinStrings(this IEnumerable<string> source, string delimeter)
        {
            return string.Join(delimeter, source.ToArray());
        }
    }
}

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)
        {
            string []s=Console.ReadLine().Split(' ');
            long a = (long.Parse(s[3]) - long.Parse(s[1]))/2;
            long b = (long.Parse(s[2]) - long.Parse(s[0]))/2;

            Console.WriteLine((a+1)*(b+1)+a*b);
            //Console.ReadLine();
        }
    }
}

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

namespace ConsoleApplication4
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            long x1 = Convert.ToInt64(s[0]);
            long y1 = Convert.ToInt64(s[1]);
            long x2 = Convert.ToInt64(s[2]);
            long y2 = Convert.ToInt64(s[3]);
            long x = Math.Abs(x1 - x2)+1;
            long y = Math.Abs(y1 - y2)+1;

            long t = x * y/2+1;

            Console.WriteLine(t);

        }
    }
}

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

namespace TempProject
{
    class Program
    {
        static void Main()
        {
            string[] s = Console.ReadLine().Split(' ');
            BigInteger x1 = BigInteger.Parse(s[0]),
                       y1 = BigInteger.Parse(s[1]),
                       x2 = BigInteger.Parse(s[2]),
                       y2 = BigInteger.Parse(s[3]);
            BigInteger col = (y2 - y1) / 2 + 1,
                       ln = (x2 - x1) / 2 + 1;
            BigInteger sum = col * ln + (col - 1) * (ln - 1);
            Console.WriteLine(sum);
            //Console.ReadKey();;

        }
    }
}

using System;
using System.Linq;
using System.Globalization;

namespace _630
{
    class Program
    {
        static void Main()
        {
            var n = Console.ReadLine().Split().Select(long.Parse).ToArray();
            var x1 = n[0]; var y1 = n[1]; var x2 = n[2]; var y2 = n[3];
            var x = Math.Abs(x1 - x2);
            var y = Math.Abs(y1 - y2);
            var ans = (x / 2 + 1) * (y / 2 + 1) + x * y / 4;
            Console.WriteLine(ans);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Numerics;
using E = System.Linq.Enumerable;

namespace Prob05 {
    class Program {
        protected IOHelper io;

        public Program(string inputFile, string outputFile) {
            io = new IOHelper(inputFile, outputFile, Encoding.Default);

            long x1 = io.NextInt();
            long y1 = io.NextInt();
            long x2 = io.NextInt();
            long y2 = io.NextInt();

            Decimal ans = (x2 - x1) * (y2 - y1) / 2.0M;
            ans += (x2 - x1) / 2 + 1;
            ans += (y2 - y1) / 2M;
            io.WriteLine(ans,0);

            io.Dispose();
        }

        static void Main(string[] args) {
            Program myProgram = new Program(null, null);
        }
    }

    class IOHelper : IDisposable {
        public StreamReader reader;
        public StreamWriter writer;

        public IOHelper(string inputFile, string outputFile, Encoding encoding) {
            if (inputFile == null)
                reader = new StreamReader(Console.OpenStandardInput(), encoding);
            else
                reader = new StreamReader(inputFile, encoding);

            if (outputFile == null)
                writer = new StreamWriter(Console.OpenStandardOutput(), encoding);
            else
                writer = new StreamWriter(outputFile, false, encoding);

            curLine = new string[] { };
            curTokenIdx = 0;
        }

        string[] curLine;
        int curTokenIdx;

        char[] whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public bool hasNext() {
            if (curTokenIdx >= curLine.Length) {
                //Read next line
                string line = reader.ReadLine();
                if (line != null)
                    curLine = line.Split(whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    curLine = new string[] { };
                curTokenIdx = 0;
            }

            return curTokenIdx < curLine.Length;
        }

        public string NextToken() {
            return hasNext() ? curLine[curTokenIdx++] : null;
        }

        public int NextInt() {
            return int.Parse(NextToken());
        }

        public double NextDouble() {
            string tkn = NextToken();
            return double.Parse(tkn, System.Globalization.CultureInfo.InvariantCulture);
        }

        public void Write(double val, int precision) {
            writer.Write(val.ToString("F" + precision, System.Globalization.CultureInfo.InvariantCulture));
        }

        public void Write(object stringToWrite) {
            writer.Write(stringToWrite);
        }

        public void WriteLine(double val, int precision) {
            writer.WriteLine(val.ToString("F" + precision, System.Globalization.CultureInfo.InvariantCulture));
        }
        public void WriteLine(Decimal val, int precision) {
            writer.WriteLine(val.ToString("F" + precision, System.Globalization.CultureInfo.InvariantCulture));
        }

        public void WriteLine(object stringToWrite) {
            writer.WriteLine(stringToWrite);
        }

        public void Dispose() {
            try {
                if (reader != null) {
                    reader.Dispose();
                }
                if (writer != null) {
                    writer.Flush();
                    writer.Dispose();
                }
            } catch { };
        }

        public void Flush() {
            if (writer != null) {
                writer.Flush();
            }
        }
    }
}

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		long HL=0,HS=0,WL=0,WS=0;
		if((X1+X2)%2==0 && (Y1+Y2)%2==0){
			WL=(X2-X1)/2+1;
			WS=(X2-X1)/2;
			HL=(Y2-Y1)/2+1;
			HS=(Y2-Y1)/2;
		}
		if((X1+X2)%2==1 && (Y1+Y2)%2==0){
		}
		if((X1+X2)%2==0 && (Y1+Y2)%2==1){
		}
		if((X1+X2)%2==1 && (Y1+Y2)%2==1){
			WL=(X2-X1)/2+1;
			WS=(X2-X1)/2+1;
			HL=(Y2-Y1)/2+1;
			HS=(Y2-Y1)/2+1;
		}
		Console.WriteLine(HL*WL+HS*WS);
	}
	long X1,X2,Y1,Y2;
	public Sol(){
		var d=rla();
		X1=d[0];Y1=d[1];X2=d[2];Y2=d[3];
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}

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

namespace codeforces
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            long x1 = Convert.ToInt64(input[0]);
            long y1 = Convert.ToInt64(input[1]);
            long x2 = Convert.ToInt64(input[2]);
            long y2 = Convert.ToInt64(input[3]);

            long v = (x2 - x1 + 1) * (y2 - y1 + 2) / 2 - (x2 - x1 + 1) / 2;
            Console.WriteLine(v);
        }
    }
}

using System;

namespace _630E_Rectangle
{
    class Program
    {
        static void Main(string[] args)
        {
            var temp = Array.ConvertAll(Console.ReadLine().Split(' '), x => Convert.ToInt32(x));
            int x1 = temp[0];
            int y1 = temp[1];
            int x2 = temp[2];
            int y2 = temp[3];

            int oddscount;
            int evenscount;
            int oddsheight;
            int evensheight;

            if ((x2 - x1)%2 == 0)
            {
                if (x2%2 == 0)
                {
                    evenscount = (x2 - x1)/2 + 1;
                    oddscount = evenscount - 1;
                }
                else
                {
                    oddscount = (x2 - x1)/2 + 1;
                    evenscount = oddscount - 1;
                }
            }
            else
            {
                oddscount = (x2 - x1 + 1)/2;
                evenscount = oddscount;
            }

            oddsheight = (y2 - y1)/2 + 1;
            if (y2%2 == 0 && y1%2 == 0)
                oddsheight--;

            evensheight = (y2 - y1)/2 + +1;
            if (y2%2 == 1 && y1%2 == 1)
                evensheight--;

            Console.WriteLine(oddscount*oddsheight + evenscount*evensheight);
        }
    }
}

using System;

namespace _630E_Rectangle
{
    class Program
    {
        static void Main(string[] args)
        {
            var temp = Array.ConvertAll(Console.ReadLine().Split(' '), x => Convert.ToInt32(x));
            int x1 = temp[0];
            int y1 = temp[1];
            int x2 = temp[2];
            int y2 = temp[3];

            int oddscount;
            int evenscount;
            int oddsheight;
            int evensheight;

            if ((x2 - x1)%2 == 0)
            {
                if (x2%2 == 0)
                {
                    evenscount = (x2 - x1)/2 + 1;
                    oddscount = evenscount - 1;
                }
                else
                {
                    oddscount = (x2 - x1)/2 + 1;
                    evenscount = oddscount - 1;
                }
            }
            else
            {
                oddscount = (x2 - x1 + 1)/2;
                evenscount = oddscount;
            }

            oddsheight = (y2 - y1)/2 + 1;
            if (Math.Abs(y2)%2 == 0 && Math.Abs(y1)%2 == 0)
                oddsheight--;

            evensheight = (y2 - y1)/2 + 1;
            if (Math.Abs(y2)%2 == 1 && Math.Abs(y1)%2 == 1)
                evensheight--;

            long answer = (long)oddscount*(long)oddsheight + (long)evenscount*(long)evensheight;

            Console.WriteLine(answer);
        }
    }
}

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

namespace _630E_Rectangle
{
    class Program
    {
        static void Main(string[] args)
        {
            var temp = Array.ConvertAll(Console.ReadLine().Split(' '), x => Convert.ToInt32(x));
            int x1 = temp[0];
            int y1 = temp[1];
            int x2 = temp[2];
            int y2 = temp[3];

            int oddscount;
            int evencount;
            int oddsheight;
            int evenheight;

            if ((x2 - x1)%2 == 0)
            {
                if (x2%2 == 0)
                {
                    evencount = (x2 - x1)/2 + 1;
                    oddscount = evencount - 1;
                }
                else
                {
                    oddscount = (x2 - x1)/2 + 1;
                    evencount = oddscount - 1;
                }
            }
            else
            {
                oddscount = (x2 - x1 + 1)/2;
                evencount = oddscount;
            }

            oddsheight = (int)Math.Floor((y2 - y1)/2.0)+1;
            evenheight = (int) Math.Ceiling((y2 - y1)/2.0);

            Console.WriteLine(oddscount*oddsheight+evencount*evenheight);
        }
    }
}

using System;

namespace _630E_Rectangle
{
    class Program
    {
        static void Main(string[] args)
        {
            var temp = Array.ConvertAll(Console.ReadLine().Split(' '), x => Convert.ToInt32(x));
            int x1 = temp[0];
            int y1 = temp[1];
            int x2 = temp[2];
            int y2 = temp[3];

            int oddscount;
            int evenscount;
            int oddsheight;
            int evensheight;

            if ((x2 - x1)%2 == 0)
            {
                if (x2%2 == 0)
                {
                    evenscount = (x2 - x1)/2 + 1;
                    oddscount = evenscount - 1;
                }
                else
                {
                    oddscount = (x2 - x1)/2 + 1;
                    evenscount = oddscount - 1;
                }
            }
            else
            {
                oddscount = (x2 - x1 + 1)/2;
                evenscount = oddscount;
            }

            oddsheight = (y2 - y1)/2 + 1;
            if (Math.Abs(y2)%2 == 0 && Math.Abs(y1)%2 == 0)
                oddsheight--;

            evensheight = (y2 - y1)/2 + 1;
            if (Math.Abs(y2)%2 == 1 && Math.Abs(y1)%2 == 1)
                evensheight--;

            Console.WriteLine(oddscount*oddsheight + evenscount*evensheight);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program : ProgramBase
    {
        private const long commonMod = 1000000007;
        private int index = 0;
        static void Main(string[] args)
        {
            var p = new Program();
            var x = p.Get();
            p.Out(x);
        }
        class Cut
        {
            public int a;
            public int b;
            public int line;
        }
        object Get()
        {
            var a = ReadLongs();
            var x1 = a[0];
            var x2 = a[2];
            var y1 = a[1];
            var y2 = a[3];
            var integ = (y2 - y1 + 1) / 2;
            var half = ((y2 - y1 + 1) & 1) == 1;
            long result = integ*(x2 - x1 + 1);
            if (half)
            {
                result += (x2 - x1 + 1) / 2;
                if (((x2 - x1 + 1) & 1) == 1)
                    if (((x1 ^ y1) & 1) == 0)
                        result += 1;
            }
            return result;
        }

        public long FastPow(long x, long pow)
        {
            if (pow == 0) return 1;
            if (pow == 1)
                return x;
            if ((pow & 1) == 0)
                return FastPow(x * x, pow / 2);
            return x * FastPow(x, pow - 1);
        }
        object Get2()
        {
            FileName = "strange";
            checked
            {
                var s = Read();
                var first = GetNext(s);
                var second = GetNext(s);
                var single = new Dictionary<char, int>();
                var twin = new Dictionary<Tuple<char, char>, List<Tuple<long, long>>>();
                single[first.Item1] = first.Item2;
                if (second == null)
                    return first.Item2;
                do
                {
                    if (!single.ContainsKey(second.Item1) || single[second.Item1] < second.Item2)
                        single[second.Item1] = second.Item2;
                    var pair = Tuple.Create(first.Item1, second.Item1);
                    if (!twin.ContainsKey(pair))
                        twin[pair] = new List<Tuple<long, long>>();
                    twin[pair].Add(Tuple.Create((long)first.Item2, (long)second.Item2));
                    first = second;
                    second = GetNext(s);
                } while (second != null);
                long result = single.Select(x => x.Value).Sum();
                foreach (var kv in twin)
                    result += ProcessPair(kv.Value);
                return result;
            }
        }

        public long ProcessPair(List<Tuple<long, long>> counts)
        {
            checked
            {
                var sorted = counts.OrderByDescending(x => x.Item1).ThenByDescending(x => x.Item2).ToArray();
                var filtered = new List<Tuple<long, long>>() { sorted[0] };
                for (int i = 1; i < sorted.Length; i++)
                    if (sorted[i].Item2 > filtered.Last().Item2)
                        filtered.Add(sorted[i]);

                var previous = filtered[0];
                var result = previous.Item1 * previous.Item2;
                for (int i = 1; i < filtered.Count; i++)
                    result += (filtered[i].Item2 - previous.Item2) * filtered[i].Item1;
                return result;
            }
        }

        public Tuple<char, int> GetNext(string s)
        {
            if (index == s.Length)
                return null;
            var ch = s[index];
            var count = 0;
            while (index < s.Length && ch == s[index])
            {
                count++;
                index++;
            }
            return Tuple.Create(ch, count);
        }

        public double ProcessPair(long[] a, long[] b, int p)
        {
            return ((double)NumberOfDivs(a, p) * 2000) / Count(a) +
                ((double)NumberOfDivs(b, p) * 2000) / Count(b) -
                ((double)(NumberOfDivs(a, p) * NumberOfDivs(b, p))) * 2000 / (Count(a) * Count(b));
        }

        public long NumberOfDivs(long[] a, int p)
        {
            return a[1] / p - (a[0] - 1) / p;
        }

        public long Count(long[] a)
        {
            return a[1] - a[0] + 1;
        }

        bool DoubleEquals(double a, double b)
        {
            return Math.Abs(a - b) < 0.0000000001;
        }

        bool SameLine(double[] a, double[] b, double[] c)
        {
            var x = a[0];
            var y = a[1];
            var x1 = b[0];
            var y1 = b[1];
            var x2 = c[0];
            var y2 = c[1];
            return DoubleEquals((x - x1) * (y2 - y1), (y - y1) * (x2 - x1));
        }

        double Distance(double[] a, double[] b)
        {
            return Math.Sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]));
        }

        object Get7()
        {
            checked
            {
                var m = ReadInt();
                var p = ReadLongs();
                var arr = p.GroupBy(x => x).Select(g => new { g.Key, Count = g.Count() }).ToArray();
                var even = arr.Where(x => (x.Count & 1) == 0).FirstOrDefault();
                if (even != null)
                {
                    var index = Array.IndexOf(arr, even);
                    //arr[index].Count = arr[index].Count / 2;
                }
                long divs = 1;
                long result = 1;
                foreach (var a in arr)
                {
                    var pi = a.Key;
                    var curr = pi;
                    var olddivs = divs;
                    var oldres = result;
                    for (int i = 0; i < a.Count; i++)
                    {
                        result = (result * oldres % commonMod) * FastPow(curr, olddivs, commonMod) % commonMod;
                        curr = curr * pi % commonMod;
                        divs = (divs + olddivs) % (commonMod - 1);
                    }
                }
                return result;
            }
        }

        public long FastPow(long x, BigInteger pow, long mod)
        {
            if (pow == 0)
                return 1;
            if ((pow & 1) == 0)
                return FastPow(x * x % mod, pow / 2, mod);
            return x * FastPow(x, pow - 1, mod) % mod;
        }

        //object Get3()
        //{
        //    FileName = "";
        //    checked
        //    {
        //        var n = ReadInt();
        //        var hor = new List<Cut>();
        //        var ver = new List<Cut>();
        //        for (int i = 0; i < n; i++)
        //        {
        //            var a = ReadInts();
        //            if (a[0] == a[2])
        //                ver.Add(new Cut() { a = Math.Min(a[1], a[3]), b = Math.Max(a[1], a[3]), line = a[0] });
        //            else
        //                hor.Add(new Cut() { a = Math.Min(a[0], a[2]), b = Math.Max(a[0], a[2]), line = a[1] });
        //        }
        //        ver = Merge(ver);
        //        hor = Merge(hor);

        //    }
        //}

        List<Cut> Merge(List<Cut> l)
        {
            var a = l.OrderBy(x => x.line).ThenBy(x => x.a).ToArray();
            Cut previous = null;
            var result = new List<Cut>();
            for (int i = 0; i < a.Length; i++)
                if (previous == null)
                    previous = a[i];
                else
                    if (previous.line == a[i].line && previous.b >= a[i].a)
                        previous.b = Math.Max(previous.b, a[i].b);
                    else
                    {
                        result.Add(previous);
                        previous = a[i];
                    }
            if (previous != null)
                result.Add(previous);
            return result;
        }

    }
    abstract class ProgramBase
    {
        bool? prod = null;
        StreamReader f;
        protected string FileName { private get; set; }

        protected string Read()
        {
            if (string.IsNullOrEmpty(FileName))
                return Console.ReadLine();
            if (f == null)
                f = new StreamReader((GetProd() ? "" : "c:\\dev\\") + FileName + ".in");
            return f.ReadLine();
        }

        protected int ReadInt()
        {
            return Convert.ToInt32(Read());
        }
        protected int[] ReadInts()
        {
            return Read().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
        }

        protected long ReadLong()
        {
            return Convert.ToInt64(Read());
        }

        protected long[] ReadLongs()
        {
            return Read().Split(' ').Select(x => Convert.ToInt64(x)).ToArray();
        }

        public void Out(object r)
        {
            if (string.IsNullOrEmpty(FileName))
                Console.WriteLine(r);
            else if (GetProd())
                File.WriteAllText(FileName + ".out", r.ToString());
            else
                Console.WriteLine(r);
        }

        private bool GetProd()
        {
            if (!prod.HasValue)
                try
                {
                    prod = Environment.MachineName != "RENADEEN-NB-W7";
                }
                catch (Exception)
                {
                    prod = true;
                }
            return prod.Value;
        }
    }

    public static class Huj
    {
        public static T MinBy<T>(this IEnumerable<T> source, Func<T, double> func) where T : class
        {
            T result = null;
            var min = double.MaxValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (min > current)
                {
                    min = current;
                    result = item;
                }
            }
            return result;
        }

        public static T MaxBy<T>(this IEnumerable<T> source, Func<T, double> func)
        {
            T result = default(T);
            var max = double.MinValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (max < current)
                {
                    max = current;
                    result = item;
                }
            }
            return result;
        }

        public static string JoinStrings(this IEnumerable<string> source, string delimeter)
        {
            return string.Join(delimeter, source.ToArray());
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program : ProgramBase
    {
        private const long commonMod = 1000000007;
        private int index = 0;
        static void Main(string[] args)
        {
            var p = new Program();
            var x = p.Get();
            p.Out(x);
        }
        class Cut
        {
            public int a;
            public int b;
            public int line;
        }
        object Get()
        {
            var a = ReadLongs();
            var x1 = a[0];
            var x2 = a[2];
            var y1 = a[1];
            var y2 = a[3];
            var integ = (y2 - y1 + 1) / 2;
            var half = ((y2 - y1 + 1) & 1) == 1;
            long result = integ*(x2 - x1 + 1);
            if (half)
            {
                result += (x2 - x1 + 1) / 2;
                if (((x2 - x1 + 1) & 1) == 1)
                    if (((x1 ^ y1) & 1) == 0)
                        result += 1;
                    else
                        result -= 1;
            }
            return result;
        }

        public long FastPow(long x, long pow)
        {
            if (pow == 0) return 1;
            if (pow == 1)
                return x;
            if ((pow & 1) == 0)
                return FastPow(x * x, pow / 2);
            return x * FastPow(x, pow - 1);
        }
        object Get2()
        {
            FileName = "strange";
            checked
            {
                var s = Read();
                var first = GetNext(s);
                var second = GetNext(s);
                var single = new Dictionary<char, int>();
                var twin = new Dictionary<Tuple<char, char>, List<Tuple<long, long>>>();
                single[first.Item1] = first.Item2;
                if (second == null)
                    return first.Item2;
                do
                {
                    if (!single.ContainsKey(second.Item1) || single[second.Item1] < second.Item2)
                        single[second.Item1] = second.Item2;
                    var pair = Tuple.Create(first.Item1, second.Item1);
                    if (!twin.ContainsKey(pair))
                        twin[pair] = new List<Tuple<long, long>>();
                    twin[pair].Add(Tuple.Create((long)first.Item2, (long)second.Item2));
                    first = second;
                    second = GetNext(s);
                } while (second != null);
                long result = single.Select(x => x.Value).Sum();
                foreach (var kv in twin)
                    result += ProcessPair(kv.Value);
                return result;
            }
        }

        public long ProcessPair(List<Tuple<long, long>> counts)
        {
            checked
            {
                var sorted = counts.OrderByDescending(x => x.Item1).ThenByDescending(x => x.Item2).ToArray();
                var filtered = new List<Tuple<long, long>>() { sorted[0] };
                for (int i = 1; i < sorted.Length; i++)
                    if (sorted[i].Item2 > filtered.Last().Item2)
                        filtered.Add(sorted[i]);

                var previous = filtered[0];
                var result = previous.Item1 * previous.Item2;
                for (int i = 1; i < filtered.Count; i++)
                    result += (filtered[i].Item2 - previous.Item2) * filtered[i].Item1;
                return result;
            }
        }

        public Tuple<char, int> GetNext(string s)
        {
            if (index == s.Length)
                return null;
            var ch = s[index];
            var count = 0;
            while (index < s.Length && ch == s[index])
            {
                count++;
                index++;
            }
            return Tuple.Create(ch, count);
        }

        public double ProcessPair(long[] a, long[] b, int p)
        {
            return ((double)NumberOfDivs(a, p) * 2000) / Count(a) +
                ((double)NumberOfDivs(b, p) * 2000) / Count(b) -
                ((double)(NumberOfDivs(a, p) * NumberOfDivs(b, p))) * 2000 / (Count(a) * Count(b));
        }

        public long NumberOfDivs(long[] a, int p)
        {
            return a[1] / p - (a[0] - 1) / p;
        }

        public long Count(long[] a)
        {
            return a[1] - a[0] + 1;
        }

        bool DoubleEquals(double a, double b)
        {
            return Math.Abs(a - b) < 0.0000000001;
        }

        bool SameLine(double[] a, double[] b, double[] c)
        {
            var x = a[0];
            var y = a[1];
            var x1 = b[0];
            var y1 = b[1];
            var x2 = c[0];
            var y2 = c[1];
            return DoubleEquals((x - x1) * (y2 - y1), (y - y1) * (x2 - x1));
        }

        double Distance(double[] a, double[] b)
        {
            return Math.Sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]));
        }

        object Get7()
        {
            checked
            {
                var m = ReadInt();
                var p = ReadLongs();
                var arr = p.GroupBy(x => x).Select(g => new { g.Key, Count = g.Count() }).ToArray();
                var even = arr.Where(x => (x.Count & 1) == 0).FirstOrDefault();
                if (even != null)
                {
                    var index = Array.IndexOf(arr, even);
                    //arr[index].Count = arr[index].Count / 2;
                }
                long divs = 1;
                long result = 1;
                foreach (var a in arr)
                {
                    var pi = a.Key;
                    var curr = pi;
                    var olddivs = divs;
                    var oldres = result;
                    for (int i = 0; i < a.Count; i++)
                    {
                        result = (result * oldres % commonMod) * FastPow(curr, olddivs, commonMod) % commonMod;
                        curr = curr * pi % commonMod;
                        divs = (divs + olddivs) % (commonMod - 1);
                    }
                }
                return result;
            }
        }

        public long FastPow(long x, BigInteger pow, long mod)
        {
            if (pow == 0)
                return 1;
            if ((pow & 1) == 0)
                return FastPow(x * x % mod, pow / 2, mod);
            return x * FastPow(x, pow - 1, mod) % mod;
        }

        //object Get3()
        //{
        //    FileName = "";
        //    checked
        //    {
        //        var n = ReadInt();
        //        var hor = new List<Cut>();
        //        var ver = new List<Cut>();
        //        for (int i = 0; i < n; i++)
        //        {
        //            var a = ReadInts();
        //            if (a[0] == a[2])
        //                ver.Add(new Cut() { a = Math.Min(a[1], a[3]), b = Math.Max(a[1], a[3]), line = a[0] });
        //            else
        //                hor.Add(new Cut() { a = Math.Min(a[0], a[2]), b = Math.Max(a[0], a[2]), line = a[1] });
        //        }
        //        ver = Merge(ver);
        //        hor = Merge(hor);

        //    }
        //}

        List<Cut> Merge(List<Cut> l)
        {
            var a = l.OrderBy(x => x.line).ThenBy(x => x.a).ToArray();
            Cut previous = null;
            var result = new List<Cut>();
            for (int i = 0; i < a.Length; i++)
                if (previous == null)
                    previous = a[i];
                else
                    if (previous.line == a[i].line && previous.b >= a[i].a)
                        previous.b = Math.Max(previous.b, a[i].b);
                    else
                    {
                        result.Add(previous);
                        previous = a[i];
                    }
            if (previous != null)
                result.Add(previous);
            return result;
        }

    }
    abstract class ProgramBase
    {
        bool? prod = null;
        StreamReader f;
        protected string FileName { private get; set; }

        protected string Read()
        {
            if (string.IsNullOrEmpty(FileName))
                return Console.ReadLine();
            if (f == null)
                f = new StreamReader((GetProd() ? "" : "c:\\dev\\") + FileName + ".in");
            return f.ReadLine();
        }

        protected int ReadInt()
        {
            return Convert.ToInt32(Read());
        }
        protected int[] ReadInts()
        {
            return Read().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
        }

        protected long ReadLong()
        {
            return Convert.ToInt64(Read());
        }

        protected long[] ReadLongs()
        {
            return Read().Split(' ').Select(x => Convert.ToInt64(x)).ToArray();
        }

        public void Out(object r)
        {
            if (string.IsNullOrEmpty(FileName))
                Console.WriteLine(r);
            else if (GetProd())
                File.WriteAllText(FileName + ".out", r.ToString());
            else
                Console.WriteLine(r);
        }

        private bool GetProd()
        {
            if (!prod.HasValue)
                try
                {
                    prod = Environment.MachineName != "RENADEEN-NB-W7";
                }
                catch (Exception)
                {
                    prod = true;
                }
            return prod.Value;
        }
    }

    public static class Huj
    {
        public static T MinBy<T>(this IEnumerable<T> source, Func<T, double> func) where T : class
        {
            T result = null;
            var min = double.MaxValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (min > current)
                {
                    min = current;
                    result = item;
                }
            }
            return result;
        }

        public static T MaxBy<T>(this IEnumerable<T> source, Func<T, double> func)
        {
            T result = default(T);
            var max = double.MinValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (max < current)
                {
                    max = current;
                    result = item;
                }
            }
            return result;
        }

        public static string JoinStrings(this IEnumerable<string> source, string delimeter)
        {
            return string.Join(delimeter, source.ToArray());
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program : ProgramBase
    {
        private const long commonMod = 1000000007;
        private int index = 0;
        static void Main(string[] args)
        {
            var p = new Program();
            var x = p.Get();
            p.Out(x);
        }
        class Cut
        {
            public int a;
            public int b;
            public int line;
        }
        object Get()
        {
            var a = ReadLongs();
            var x1 = a[0];
            var x2 = a[2];
            var y1 = a[1];
            var y2 = a[3];
            var integ = (y2 - y1 + 1) / 2;
            var half = ((y2 - y1 + 1) & 1) == 1;
            long result = integ*(x2 - x1 + 1);
            if (half)
            {
                result += (x2 - x1 + 1) / 2;
                if (((x2 - x1 + 1) & 1) == 1)
                    if ((x1 ^ y1 & 1) == 0)
                        result += 1;
                    else
                        result -= 1;
            }
            return result;
        }

        public long FastPow(long x, long pow)
        {
            if (pow == 0) return 1;
            if (pow == 1)
                return x;
            if ((pow & 1) == 0)
                return FastPow(x * x, pow / 2);
            return x * FastPow(x, pow - 1);
        }
        object Get2()
        {
            FileName = "strange";
            checked
            {
                var s = Read();
                var first = GetNext(s);
                var second = GetNext(s);
                var single = new Dictionary<char, int>();
                var twin = new Dictionary<Tuple<char, char>, List<Tuple<long, long>>>();
                single[first.Item1] = first.Item2;
                if (second == null)
                    return first.Item2;
                do
                {
                    if (!single.ContainsKey(second.Item1) || single[second.Item1] < second.Item2)
                        single[second.Item1] = second.Item2;
                    var pair = Tuple.Create(first.Item1, second.Item1);
                    if (!twin.ContainsKey(pair))
                        twin[pair] = new List<Tuple<long, long>>();
                    twin[pair].Add(Tuple.Create((long)first.Item2, (long)second.Item2));
                    first = second;
                    second = GetNext(s);
                } while (second != null);
                long result = single.Select(x => x.Value).Sum();
                foreach (var kv in twin)
                    result += ProcessPair(kv.Value);
                return result;
            }
        }

        public long ProcessPair(List<Tuple<long, long>> counts)
        {
            checked
            {
                var sorted = counts.OrderByDescending(x => x.Item1).ThenByDescending(x => x.Item2).ToArray();
                var filtered = new List<Tuple<long, long>>() { sorted[0] };
                for (int i = 1; i < sorted.Length; i++)
                    if (sorted[i].Item2 > filtered.Last().Item2)
                        filtered.Add(sorted[i]);

                var previous = filtered[0];
                var result = previous.Item1 * previous.Item2;
                for (int i = 1; i < filtered.Count; i++)
                    result += (filtered[i].Item2 - previous.Item2) * filtered[i].Item1;
                return result;
            }
        }

        public Tuple<char, int> GetNext(string s)
        {
            if (index == s.Length)
                return null;
            var ch = s[index];
            var count = 0;
            while (index < s.Length && ch == s[index])
            {
                count++;
                index++;
            }
            return Tuple.Create(ch, count);
        }

        public double ProcessPair(long[] a, long[] b, int p)
        {
            return ((double)NumberOfDivs(a, p) * 2000) / Count(a) +
                ((double)NumberOfDivs(b, p) * 2000) / Count(b) -
                ((double)(NumberOfDivs(a, p) * NumberOfDivs(b, p))) * 2000 / (Count(a) * Count(b));
        }

        public long NumberOfDivs(long[] a, int p)
        {
            return a[1] / p - (a[0] - 1) / p;
        }

        public long Count(long[] a)
        {
            return a[1] - a[0] + 1;
        }

        bool DoubleEquals(double a, double b)
        {
            return Math.Abs(a - b) < 0.0000000001;
        }

        bool SameLine(double[] a, double[] b, double[] c)
        {
            var x = a[0];
            var y = a[1];
            var x1 = b[0];
            var y1 = b[1];
            var x2 = c[0];
            var y2 = c[1];
            return DoubleEquals((x - x1) * (y2 - y1), (y - y1) * (x2 - x1));
        }

        double Distance(double[] a, double[] b)
        {
            return Math.Sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]));
        }

        object Get7()
        {
            checked
            {
                var m = ReadInt();
                var p = ReadLongs();
                var arr = p.GroupBy(x => x).Select(g => new { g.Key, Count = g.Count() }).ToArray();
                var even = arr.Where(x => (x.Count & 1) == 0).FirstOrDefault();
                if (even != null)
                {
                    var index = Array.IndexOf(arr, even);
                    //arr[index].Count = arr[index].Count / 2;
                }
                long divs = 1;
                long result = 1;
                foreach (var a in arr)
                {
                    var pi = a.Key;
                    var curr = pi;
                    var olddivs = divs;
                    var oldres = result;
                    for (int i = 0; i < a.Count; i++)
                    {
                        result = (result * oldres % commonMod) * FastPow(curr, olddivs, commonMod) % commonMod;
                        curr = curr * pi % commonMod;
                        divs = (divs + olddivs) % (commonMod - 1);
                    }
                }
                return result;
            }
        }

        public long FastPow(long x, BigInteger pow, long mod)
        {
            if (pow == 0)
                return 1;
            if ((pow & 1) == 0)
                return FastPow(x * x % mod, pow / 2, mod);
            return x * FastPow(x, pow - 1, mod) % mod;
        }

        //object Get3()
        //{
        //    FileName = "";
        //    checked
        //    {
        //        var n = ReadInt();
        //        var hor = new List<Cut>();
        //        var ver = new List<Cut>();
        //        for (int i = 0; i < n; i++)
        //        {
        //            var a = ReadInts();
        //            if (a[0] == a[2])
        //                ver.Add(new Cut() { a = Math.Min(a[1], a[3]), b = Math.Max(a[1], a[3]), line = a[0] });
        //            else
        //                hor.Add(new Cut() { a = Math.Min(a[0], a[2]), b = Math.Max(a[0], a[2]), line = a[1] });
        //        }
        //        ver = Merge(ver);
        //        hor = Merge(hor);

        //    }
        //}

        List<Cut> Merge(List<Cut> l)
        {
            var a = l.OrderBy(x => x.line).ThenBy(x => x.a).ToArray();
            Cut previous = null;
            var result = new List<Cut>();
            for (int i = 0; i < a.Length; i++)
                if (previous == null)
                    previous = a[i];
                else
                    if (previous.line == a[i].line && previous.b >= a[i].a)
                        previous.b = Math.Max(previous.b, a[i].b);
                    else
                    {
                        result.Add(previous);
                        previous = a[i];
                    }
            if (previous != null)
                result.Add(previous);
            return result;
        }

    }
    abstract class ProgramBase
    {
        bool? prod = null;
        StreamReader f;
        protected string FileName { private get; set; }

        protected string Read()
        {
            if (string.IsNullOrEmpty(FileName))
                return Console.ReadLine();
            if (f == null)
                f = new StreamReader((GetProd() ? "" : "c:\\dev\\") + FileName + ".in");
            return f.ReadLine();
        }

        protected int ReadInt()
        {
            return Convert.ToInt32(Read());
        }
        protected int[] ReadInts()
        {
            return Read().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
        }

        protected long ReadLong()
        {
            return Convert.ToInt64(Read());
        }

        protected long[] ReadLongs()
        {
            return Read().Split(' ').Select(x => Convert.ToInt64(x)).ToArray();
        }

        public void Out(object r)
        {
            if (string.IsNullOrEmpty(FileName))
                Console.WriteLine(r);
            else if (GetProd())
                File.WriteAllText(FileName + ".out", r.ToString());
            else
                Console.WriteLine(r);
        }

        private bool GetProd()
        {
            if (!prod.HasValue)
                try
                {
                    prod = Environment.MachineName != "RENADEEN-NB-W7";
                }
                catch (Exception)
                {
                    prod = true;
                }
            return prod.Value;
        }
    }

    public static class Huj
    {
        public static T MinBy<T>(this IEnumerable<T> source, Func<T, double> func) where T : class
        {
            T result = null;
            var min = double.MaxValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (min > current)
                {
                    min = current;
                    result = item;
                }
            }
            return result;
        }

        public static T MaxBy<T>(this IEnumerable<T> source, Func<T, double> func)
        {
            T result = default(T);
            var max = double.MinValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (max < current)
                {
                    max = current;
                    result = item;
                }
            }
            return result;
        }

        public static string JoinStrings(this IEnumerable<string> source, string delimeter)
        {
            return string.Join(delimeter, source.ToArray());
        }
    }
}


using System;
using System.Collections.Generic;
namespace _822D
{
    class Program
    {
        static long MOD = 1000000007;
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            long t = long.Parse(input[0]), l = long.Parse(input[1]), r = long.Parse(input[2]);
            long[] dp = new long[r + 1], lp = new long[r + 1];
            List<long> pr = new List<long>();
            long mult;
            for (long i = 2; i <= r; i++)
            {
                if (lp[i] == 0)
                {
                    lp[i] = i;
                    pr.Add(i);
                }
                for (int j = 0; j < pr.Count && pr[j] <= lp[i] && (mult = i * pr[j]) <= r; j++)
                    lp[mult] = pr[j];
            }
            for (long i = 2; i <= r; i++)
            {
                if (lp[i] == i)
                    dp[i] = ((i * (i - 1)) / 2) % MOD;
                else
                    dp[i] = ((dp[lp[i]] * (i / lp[i])) % MOD + dp[i / lp[i]]) % MOD;
            }
            long currT = 1, result = 0;
            for (long i = l; i <= r; i++)
            {
                result = (result + (currT * dp[i]) % MOD) % MOD;
                currT = (currT * t) % MOD;
            }
            Console.WriteLine(result);
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace My_pretty_girl_Noora
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int t = Next();
            int l = Next();
            int r = Next();

            var nn = new long[r + 1];
            for (int i = 2; i < nn.Length; i++)
            {
                nn[i] = long.MaxValue;
            }
            nn[1] = 1;
            for (long i = 2; i < nn.Length; i++)
            {
                nn[i] = Math.Min(nn[i], i*(i - 1)/2);

                long max = Math.Min(i*i, r);
                long y = 2;
                for (long j = i + i; j <= max; j += i, y++)
                {
                    var tt = nn[i] + i*nn[y];
                    if (nn[j] > tt)
                        nn[j] = tt;
                    //nn[j] = Math.Min(nn[j], nn[i] + i*nn[y]);
                }
            }

            long sum = 0;
            long k = 1;
            int mod = 1000000007;

            for (int i = l; i <= r; i++)
            {
                sum = (sum + k*(nn[i]%mod))%mod;
                k = (k*t)%mod;
            }

            writer.WriteLine(sum);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace My_pretty_girl_Noora
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int t = Next();
            int l = Next();
            int r = Next();

            var nn = new long[r + 1];
            for (int i = 2; i < nn.Length; i++)
            {
                nn[i] = long.MaxValue;
            }
            nn[1] = 1;
            for (long i = 2; i < nn.Length; i++)
            {
                nn[i] = Math.Min(nn[i], i*(i - 1)/2);

                long max = Math.Min(i*i, r);
                long y = 2;
                for (long j = i + i; j <= max; j += i, y++)
                {
                    long tt = nn[i] + i*nn[y];
                    if (nn[j] > tt)
                        nn[j] = tt;
                }
            }

            long sum = 0;
            int mod = 1000000007;

            for (int i = r; i >= l; i--)
            {
                sum = (sum*t + nn[i])%mod;
            }

            writer.WriteLine(sum);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

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

namespace Test
{
    class IOHelper : IDisposable
    {
        StreamReader reader;
        StreamWriter writer;

        public IOHelper(string inputFile, string outputFile, Encoding encoding)
        {
            StreamReader iReader;
            StreamWriter oWriter;
            if (inputFile == null)
                iReader = new StreamReader(Console.OpenStandardInput(), encoding);
            else
                iReader = new StreamReader(inputFile, encoding);

            if (outputFile == null)
                oWriter = new StreamWriter(Console.OpenStandardOutput(), encoding);
            else
                oWriter = new StreamWriter(outputFile, false, encoding);

            reader = iReader;
            writer = oWriter;

            curLine = new string[] { };
            curTokenIdx = 0;
        }

        string[] curLine;
        int curTokenIdx;

        char[] whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public string ReadNextToken()
        {
            if (curTokenIdx >= curLine.Length)
            {
                //Read next line
                string line = reader.ReadLine();
                if (line != null)
                    curLine = line.Split(whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    curLine = new string[] { };
                curTokenIdx = 0;
            }

            if (curTokenIdx >= curLine.Length)
                return null;

            return curLine[curTokenIdx++];
        }

        public int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        public double ReadNextDouble()
        {
            var nextToken = ReadNextToken();
            var result = 0.0;
            nextToken = nextToken.Replace(".", System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator);
            result = double.Parse(nextToken);
            return result;
        }

        public void Write(string stringToWrite)
        {
            writer.Write(stringToWrite);
        }

        public void WriteLine(string stringToWrite)
        {
            writer.WriteLine(stringToWrite);
        }

        public void WriteLine(double valueToWrite)
        {
            long intPart = (long)valueToWrite;
            double fracPart = valueToWrite - intPart;
            var fracPartStr = fracPart.ToString();
            if (fracPartStr.Length > 1)
                fracPartStr = fracPartStr.Substring(2);
            var strToWrite = string.Format("{0}.{1}", intPart, fracPartStr);
            writer.WriteLine(strToWrite);
        }

        public void Dispose()
        {
            try
            {
                if (reader != null)
                {
                    reader.Dispose();
                }
                if (writer != null)
                {
                    writer.Dispose();
                }
            }
            catch { };
        }

        public void Flush()
        {
            if (writer != null)
            {
                writer.Flush();
            }
        }
    }

    class Program
    {
        protected IOHelper ioHelper;

        int t;
        int l, r;

        int prime = 1000000007;

        long[] ans;

        List<int> primes = new List<int>();

        int primeLimit;

        bool IsPrime(int i)
        {
            foreach(var prime in primes)
            {
                if (prime * prime > i)
                    return true;

                if (i % prime == 0)
                    return false;
            }

            return true;
        }

        public void Solve()
        {
            t = ioHelper.ReadNextInt();
            l = ioHelper.ReadNextInt();
            r = ioHelper.ReadNextInt();

            // n = p0 * p1 *  ... * pk. pi = numar prim. p[i+1]>=p[i].
            // R = n/2 * ( (p0-1) + (p1-1)/p0 + (p2-1)/(p0*p1) + (p3-1)/(p0*p1*p2) + ... ).

            primeLimit = (int)Math.Ceiling(Math.Sqrt(r)+1);

            ans = new long[r+1];

            ans[0] = 0;
            ans[1] = 0;

            int i, j;

            primes.Add(2);

            for (i = 3; i <= primeLimit; i++)
                if (IsPrime(i))
                    primes.Add(i);

            for (i = primeLimit + 1; i <= r; i++)
                if (IsPrime(i))
                    ans[i] = (i * (long)(i - 1) / 2) % prime;

            for (j = primes.Count - 1; j >= 0; j--)
                for (i = 1; i * primes[j] <= r; i++)
                    if (ans[i] > 0 || i==1)
                    {
                        var p = primes[j];
                        var n = i * p;

                        long rz = n * (long)(p - 1) / 2;
                        rz += ans[i];

                        rz %= prime;

                        ans[n] = rz;
                    }

            long coeff = 1;
            long rez = 0;

            for(i=l;i<=r;i++)
            {
                if (ans[i] == 0)
                    ans[i] = i * (long)(i - 1) / 2;

                ans[i] %= prime;

                rez += (ans[i] * coeff) % prime;

                rez %= prime;

                coeff *= t;
                coeff %= prime;
            }

            ioHelper.WriteLine(rez.ToString());
            ioHelper.Flush();

            //Console.ReadKey();
        }

        public Program(string inputFile, string outputFile)
        {
            ioHelper = new IOHelper(inputFile, outputFile, Encoding.Default);
            Solve();
            ioHelper.Dispose();
        }

        static void Main(string[] args)
        {
            Program myProgram = new Program(null, null);
        }
    }
}

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        string[] str = Console.ReadLine().Split(' ');
        long count = 0;
        long t = int.Parse(str[0]);
        int l = int.Parse(str[1]);
        int r = int.Parse(str[2]);
        Generateprimenumber G = new Generateprimenumber(r+1);
        long[] A = new long[r+1];
        for(int i=0;i<r+1;i++){
            A[i] = i*(i-1)/2;
        }
        A[1] = 0;
        for(int i=1;i<r;i++){
            for(int j=2;i*j<=r;j++){
                A[i*j] = A[i] + (long)j*(long)(j-1)/2*i;
            }
        }
        long T = 1;
        for(int i=l;i<=r;i++){
            count = (count + T*(A[i] % Define.mod)) % Define.mod;
            T = T * t % Define.mod;
        }
        sb.Append(count+"\n");
    }
}
class Generateprimenumber{
    public long[] p;
    public int length;
    public Generateprimenumber(int n){
        bool[] a = new bool[n+1];
        List<long> pp = new List<long>();
        int j = 2;
        for(int i=0;i<n+1;i++){
            a[i] = true;
        }
        while(j<=n){
            if(a[j]){
                pp.Add(j);
                for(int i=j;(long)i*(long)j<=n;i++){
                    a[i*j] = false;
                }
            }
            j++;
        }
        length = pp.Count;
        p = pp.ToArray();
    }
    public long[] Divisor(long n){
        List<int> pp = new List<int>();
        long num = n;
        int count = 1;
        bool last = false;
        for(int i=0;p[i]*p[i] <= num;i++){
            int j=0;
            while(num % p[i] == 0){
                num /= p[i];
                j++;
            }
            pp.Add(j);
            count *= j+1;
        }
        if(num != 1){
            pp.Add(1);
            count *= 2;
            last = true;
        }
        long[] div = new long[count];
        for(int i=0;i<count;i++){
            long x = 1;
            int y = i;
            int z = count;
            for(int j=0;j<pp.Count;j++){
                z /= pp[j]+1;
                int k = y/z;
                y %= z;
                for(int l=0;l<k;l++){
                    x *= j == pp.Count - 1 && last ? num : p[j];
                }
            }
            div[i] = x;
        }
        return div;
    }
}
public static class Define{
    public const long mod = 1000000007;
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            //var dt = System.DateTime.Now;
            int t = int.Parse(str[0]);
            int l = int.Parse(str[1]);
            int r = int.Parse(str[2]);
            int mod = 1000000007;
            int[] sieve = new int[r+1];
            long[] f = new long[r+1];

            for(int i = 2; i*i <= r; i++)
                if( sieve[i] == 0)
                    for(int j = i*i; j <= r; j+=i)
                        if(sieve[j] == 0)
                            sieve[j] = i;

            for(int i = 2; i <= r; i++) if(sieve[i] == 0) sieve[i] = i;

            f[1] = 0;
            for(int i = 2; i <= r; i++){
                int d = sieve[i];
                f[i] = f[i / d] + (((long)i * (d - 1)) >> 1);
            }

            int res = 0;

            for (int i = r; i >= l; i--) res =  (int) ( ((long)res * t + f[i]) % mod );

            Console.WriteLine(res);
            //Console.WriteLine(System.DateTime.Now - dt);
        }
    }

}

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        string[] str = Console.ReadLine().Split(' ');
        long count = 0;
        long t = int.Parse(str[0]);
        int l = int.Parse(str[1]);
        int r = int.Parse(str[2]);
        Generateprimenumber G = new Generateprimenumber(r+1);
        long[] A = new long[r+1];
        for(int i=0;i<r+1;i++){
            A[i] = i*(i-1)/2;
        }
        A[1] = 0;
        for(int i=1;i<r;i++){
            for(int j=2;i*j<=r;j++){
                A[i*j] = A[i] + (long)j*(long)(j-1)/2*i;
            }
        }
        long T = 1;
        for(int i=l;i<=r;i++){
            count = (count + T*A[i]) % Define.mod;
            T = T * t % Define.mod;
        }
        sb.Append(count+"\n");
    }
}
class Generateprimenumber{
    public long[] p;
    public int length;
    public Generateprimenumber(int n){
        bool[] a = new bool[n+1];
        List<long> pp = new List<long>();
        int j = 2;
        for(int i=0;i<n+1;i++){
            a[i] = true;
        }
        while(j<=n){
            if(a[j]){
                pp.Add(j);
                for(int i=j;(long)i*(long)j<=n;i++){
                    a[i*j] = false;
                }
            }
            j++;
        }
        length = pp.Count;
        p = pp.ToArray();
    }
    public long[] Divisor(long n){
        List<int> pp = new List<int>();
        long num = n;
        int count = 1;
        bool last = false;
        for(int i=0;p[i]*p[i] <= num;i++){
            int j=0;
            while(num % p[i] == 0){
                num /= p[i];
                j++;
            }
            pp.Add(j);
            count *= j+1;
        }
        if(num != 1){
            pp.Add(1);
            count *= 2;
            last = true;
        }
        long[] div = new long[count];
        for(int i=0;i<count;i++){
            long x = 1;
            int y = i;
            int z = count;
            for(int j=0;j<pp.Count;j++){
                z /= pp[j]+1;
                int k = y/z;
                y %= z;
                for(int l=0;l<k;l++){
                    x *= j == pp.Count - 1 && last ? num : p[j];
                }
            }
            div[i] = x;
        }
        return div;
    }
}
public static class Define{
    public const long mod = 1000000007;
}

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        string[] str = Console.ReadLine().Split(' ');
        long count = 0;
        long t = int.Parse(str[0]);
        int l = int.Parse(str[1]);
        int r = int.Parse(str[2]);
        long[] A = new long[r+1];
        for(int i=0;i<r+1;i++){
            A[i] = (long)i*(long)(i-1)/2;
        }
        A[1] = 0;
        for(int i=1;i<r;i++){
            for(int j=i;i<=r/j;j++){
                A[i*j] = Math.Min(A[i] + (long)j*(long)(j-1)/2*i,A[i*j]);
            }
        }
        long T = 1;
        for(int i=l;i<=r;i++){
            count = (count + T*(A[i] % Define.mod)) % Define.mod;
            T = T * t % Define.mod;
        }
        sb.Append(count+"\n");
    }
}
public static class Define{
    public const long mod = 1000000007;
}

using System;
using System.IO;
using System.Text;

namespace My_pretty_girl_Noora
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int t = Next();
            int l = Next();
            int r = Next();

            var nn = new long[r + 1];
            for (int i = 0; i < nn.Length; i++)
            {
                nn[i] = long.MaxValue;
            }
            nn[1] = 1;
            for (long i = 2; i < nn.Length; i++)
            {
                if (nn[i] == long.MaxValue)
                {
                    nn[i] = i*(i - 1)/2;
                }

                long max = Math.Min(i*i, r);
                for (long j = i + i; j <= max; j += i)
                {
                    nn[j] = Math.Min(nn[j], nn[i] + i*nn[j/i]);
                }
            }

            long sum = 0;
            long k = 1;
            int mod = 1000000007;

            for (int i = l; i <= r; i++)
            {
                sum = (sum + k*nn[i])%mod;
                k = (k*t)%mod;
            }

            writer.WriteLine(sum);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.IO;
using System.Linq;
using System.Text;

namespace My_pretty_girl_Noora
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int t = Next();
            int l = Next();
            int r = Next();

            var nn = new long[r + 1];
            for (int i = 2; i < nn.Length; i++)
            {
                nn[i] = long.MaxValue;
            }
            nn[1] = 1;
            for (long i = 2; i < nn.Length; i++)
            {
                if (nn[i] == long.MaxValue)
                {
                    nn[i] = i*(i - 1)/2;
                }

                long max = Math.Min(i*i, r);
                for (long j = i + i; j <= max; j += i)
                {
                    nn[j] = Math.Min(nn[j], nn[i] + i*nn[j/i]);
                }
            }

            writer.WriteLine(nn.Max());

            long sum = 0;
            long k = 1;
            int mod = 1000000007;

            for (int i = l; i <= r; i++)
            {
                sum = (sum + k*(nn[i]%mod))%mod;
                k = (k*t)%mod;
            }

            writer.WriteLine(sum);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace My_pretty_girl_Noora
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int t = Next();
            int l = Next();
            int r = Next();

            var nn = new long[r + 1];
            for (int i = 0; i < nn.Length; i++)
            {
                nn[i] = long.MaxValue;
            }
            nn[1] = 1;
            for (long i = 2; i < nn.Length; i++)
            {
                if (nn[i] == long.MaxValue)
                {
                    nn[i] = i*(i - 1)/2;
                }

                long max = Math.Min(i*i, r);
                for (long j = i + i; j <= max; j += i)
                {
                    nn[j] = Math.Min(nn[j], nn[i] + i*nn[j/i]);
                }
            }

            long sum = 0;
            long k = 1;
            int mod = 1000000007;

            for (int i = l; i <= r; i++)
            {
                sum = (sum + k*(nn[i])%mod)%mod;
                k = (k*t)%mod;
            }

            writer.WriteLine(sum);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}