Manao is trying to open a rather challenging lock. The lock has n buttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it either stays pressed into the lock (that means that you've guessed correctly and pushed the button that goes next in the sequence), or all pressed buttons return to the initial position. When all buttons are pressed into the lock at once, the lock opens.Consider an example with three buttons. Let's say that the opening sequence is: {2, 3, 1}. If you first press buttons 1 or 3, the buttons unpress immediately. If you first press button 2, it stays pressed. If you press 1 after 2, all buttons unpress. If you press 3 after 2, buttons 3 and 2 stay pressed. As soon as you've got two pressed buttons, you only need to press button 1 to open the lock.Manao doesn't know the opening sequence. But he is really smart and he is going to act in the optimal way. Calculate the number of times he's got to push a button in order to open the lock in the worst-case scenario.

A single line contains integer n (1 ≤ n ≤ 2000) — the number of buttons the lock has.

In a single line print the number of times Manao has to push a button in the worst-case scenario.

NoteConsider the first test sample. Manao can fail his first push and push the wrong button. In this case he will already be able to guess the right one with his second push. And his third push will push the second right button. Thus, in the worst-case scenario he will only need 3 pushes.

using System;
class Program
    {
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            long result = n;
            result += (((n * n - n) / 2L) * n);
            result -= ((n * n - n) * (2 * n - 1L) / 6L);
            Console.WriteLine(result);
        }
    }

using System;

namespace Zad1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Convert.ToInt32(Console.ReadLine());

            var res = 0;
            for (var i = n - 1; i >= 1; i--)
            {
                res += i * (n - 1 - i + 1);
            }
            res += n;
            Console.WriteLine(res);
        }
    }
}

using System;
class Program
{
    static void Main()
    {
        var n = long.Parse(Console.ReadLine());
        Console.WriteLine(n * (n * n + 5L) / 6L);
    }
}

using System;

class Program {
  static void Main() {
    var n = int.Parse(Console.ReadLine());
    var sum = n;
    for (var i = 1 ; i < n ; i++) sum += (n-i)*i;
    Console.WriteLine(sum);
  }
}

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

namespace Problems
{
    class Buttons
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int s = 0;
            for (int i = 0; i < n; i++)
                s += n - i + i * (n - i - 1);
            Console.WriteLine(s);
        }
    }
}

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

namespace ConsoleApplication22
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Int64 count = n;

            if (n == 1) { Console.WriteLine(1); return; }

            for (int i = 1; i < n; i++)
            {
                count += (i * (n - i));
            }

            Console.WriteLine(count);
        }
        // 1,2,3         1,2(2)   3(3)  3,3(4) 3,1(5) 3,2(6) 3,2,1

        private static IEnumerable<string> Perms(string source)
        {
            if (source.Length == 1) return new List<string>() { source };

            var perm = from l in source
                       from _x in Perms(string.Join("",
source.Where(x => x != l)
))
                       select l + _x; ;
            return perm;
        }
    }
}

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

namespace Codeforces
{
    class _268B
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int s = n;
            for (int i = 1; i < n; i++)
            {
                s = s + i * (n - i);
            }
            Console.WriteLine(s);
        }
    }
}

using System;

namespace b268
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            string[] res = Console.ReadLine().Split (new char[]{' '});
            UInt64 n = Convert.ToUInt64(res[0]);
            UInt64 tot = 0;
            for (UInt64 i = 0; i < n; i++)
                tot += (n-i-1)*(i+1);

            tot += n;

            Console.WriteLine(tot);
        }
    }
}

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

namespace ProjectEuler
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = Convert.ToInt64(Console.ReadLine());
            Console.WriteLine(n*(n*n + 5)/6);
        }
    }
}

using System;

namespace CodeForce
{
    class _268B_Buttons
    {
        static void Main()
        {
            var buttonsAmount = int.Parse(Console.ReadLine());
            var result = buttonsAmount;

            for(var i = 1; i < buttonsAmount; i++)
            {
                result += i * (buttonsAmount - i);
            }

            Console.WriteLine(result);
        }
    }
}

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

namespace COJ
{
    class Program
    {
        static int k = 0;
        static List<int> cycle = new List<int>();
        static int[] visitedTime;
        static void Main(string[] args)
        {
            //TextReader tr = Console.In;
            //Console.SetIn(new StreamReader(@"d:\lmo.in"));

            int n = int.Parse(Console.ReadLine());
            int cnt = 0;
            for (int i = 0; i < n; i++)
            {
                cnt += (n - i )* i + 1;
            }
            Console.WriteLine(cnt);

            //Console.SetIn(tr);
            Console.ReadLine();
        }

        static void DFS(List<List<int>> adyL, int s, int n)
        {
            visitedTime[s] = n;
            cycle.Add(s + 1);
            // Looking for adyacent nodes
            for (int i = 0; i < adyL[s].Count; i++)
            {
                int nextNode = adyL[s][i];
                if (visitedTime[nextNode] > 0 && visitedTime[s] - visitedTime[nextNode] >= k)
                {
                    int tmp = cycle.IndexOf(nextNode + 1);
                    Console.WriteLine(cycle.Count - tmp);
                    string auxS = "";
                    for (int h = tmp; h < cycle.Count; h++)
                    {
                        auxS += cycle[h] + " ";
                    }
                    Console.WriteLine(auxS.Trim());
                    return;
                }
                else if (visitedTime[nextNode] == 0)
                {
                    DFS(adyL, nextNode, n + 1);
                    return;
                }
            }

        }

        static int ABS(int a)
        {
            if (a < 0)
                a *= -1;
            return a;
        }

        static void PrintMt(int[,] mt)
        {
            for (int i = 0; i < mt.GetLength(0); i++)
            {
                for (int j = 0; j < mt.GetLength(1); j++)
                {
                    Console.Write(mt[i, j] + " ");
                }
                Console.WriteLine();
            }
        }

    }

}

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

class Program
{

    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        long count = 0;

        long know = 0;

        if (n == 1)
        {
            know = 1;
        }

        for (int i = 0; i < n; i++)
        {
            //Console.WriteLine("know " + know);
            count += know;

            if(know<n){
                for (int j = 0; j < n - know - 1; j++)
                {
                    if (j == 0)
                    {
                        //Console.WriteLine("search " + (1));
                        count +=  1;
                    }
                    else
                    {
                        //Console.WriteLine("search " + (know+1));
                        count += know + 1;
                    }
                }
            }

            know++;

            if(know == n-1)
            {
                know++;
            }
        }

        Console.WriteLine(count);
    }

}

using System;

class B268 {
    public static void Main() {
        var n = long.Parse(Console.ReadLine());
        Console.WriteLine(n * (n * n + 5) / 6);
    }
}

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

namespace _268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int sum = 0, S = 0, s = 0;
            for (int i = 1; i < n; i++)
			{
                sum += (n-1)*i;
                S += i * i;
			}
            for (int i = 1; i <= n; i++)
            {
                s += i;
            }
            Console.Write(s + sum - S);
            Console.ReadLine();
        }
    }
}

    using System;

    namespace Issue_268B
    {
        class Program
        {
            public static void Main(string[] args) {
                var n = ReadInt();
                var sum = 0;

                for (int i = 1; i <= n; ++i) {
                    sum += i * (n - i) + 1;
                }

                Console.WriteLine(sum);
            }

            private static bool IsInputError = false;
            private static bool IsEndOfLine = false;

            private static int ReadInt() {
                const int zeroCode = (int) '0';

                var result = 0;
                var isNegative = false;
                var symbol = Console.Read();
                IsInputError = false;
                IsEndOfLine = false;

                while (symbol == ' ') {
                    symbol = Console.Read();
                }

                if (symbol == '-') {
                    isNegative = true;
                    symbol = Console.Read();
                }

                for ( ;
                    (symbol != -1) && (symbol != ' ');
                    symbol = Console.Read()
                ) {
                    var digit = symbol - zeroCode;

                    // if symbol == \n
                    if (symbol == 13) {
                        // skip next \r symbol
                        Console.Read();
                        IsEndOfLine = true;
                        break;
                    }

                    if (digit < 10 && digit >= 0) {
                        var cache1 = result << 1;
                        var cache2 = cache1 << 2;
                        result = cache1 + cache2 + digit;
                    } else {
                        IsInputError = true;
                        break;
                    }
                }

                return isNegative ? ~result + 1 : result;
            }
        }
    }

using System;

namespace _268B
{
    static class Program
    {
        static void Main()
        {
            var s = short.Parse(Console.ReadLine());
            var r = 0;
            for (int i = s, j = 0; i > 0; i--, j++)
            {
                r += i+(i-1)*j;
            }
            Console.WriteLine(r);
        }
    }
}

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

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();

			//var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

			var n = int.Parse(input1);

			if (n == 1)
			{
				Console.WriteLine(1);
				return;
			}

			long count = n;
			for (int i = 2; i <= n; i++)
			{
				count += i * (n - i) + 1;
			}

			Console.WriteLine(count);
		}

		//private static long GCD(long a, long b)
		//{
		//	long max = Math.Max(a, b);
		//	long min = Math.Min(a, b);

		//	if (min == 0)
		//	{
		//		return max;
		//	}

		//	a = min;
		//	b = max % min;
		//	return GCD(a, b);
		//}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
            a = Convert.ToInt32(Console.ReadLine());

            int hasil=0;
            int flag=a-2;
            int flag2 = 1;
            for (int i = 0; i < a; i++)
            {

                if (i == (a - 2))
                {
                    hasil += 1;
                }
                else if (i == (a - 1) || i==0)
                {
                    hasil += a;
                }
                else
                {
                    hasil += (a - i) + (flag * flag2);
                    flag2++;
                    flag--;
                }
            }
            Console.WriteLine(hasil);
            Console.ReadLine();
        }
    }
}

//2
//1 2
//2
//1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;

static class Utils
{
    public static int ReadInt()
    {
        return Convert.ToInt32(Console.ReadLine());
    }
    public static int[] ReadIntArray()
    {
        return (from s in Console.ReadLine().Split(' ') select Convert.ToInt32(s)).ToArray();
    }
    public static List<int> ReadIntList()
    {
        return (from s in Console.ReadLine().Split(' ') select Convert.ToInt32(s)).ToList();
    }

}

class Program
{
    static void Main(string[] args)
    {
        Buttons();
    }

    static void Buttons()
    {
        int n = Utils.ReadInt();
        int ans = n;
        for(int i = 1; i <= n; i++)
        {
            ans += (n - i) * i;
        }
        Console.WriteLine(ans);
    }

    static void Lanterns()
    {
        //find the largest gap and divied by two
        int[] n_l = Utils.ReadIntArray();
        List<int> arr = Utils.ReadIntList();
        arr.Sort();
        int max = 0;
        for (int i = 0; i < arr.Count - 1; i++)
        {
            max = Math.Max(max, arr[i + 1] - arr[i]);

        }
        double ans = max / 2.0;
        ans = Math.Max(ans, (double)arr[0] - 0);
        ans = Math.Max(ans, (double)n_l[1] - arr.Last());

        Console.WriteLine(ans.ToString("F10",CultureInfo.GetCultureInfo("en-US")));

    }

    static void Ringroad()
    {
        long count = 0;
        long[] n_m = (from int i in Utils.ReadIntArray() select Convert.ToInt64(i)).ToArray();
        List<long> arr = (from int i in Utils.ReadIntArray() select Convert.ToInt64(i)).ToList();
        arr.Insert(0, 1L);
        for(long i =0; i < (long)arr.Count -1; i++)
        {
            long diff = arr[(int)i + 1] - arr[(int)i];
            count += (( diff >= 0) ? diff : diff + n_m[0]);
        }
        Console.WriteLine(count);
    }

    /// <summary>
    /// brute force works
    /// </summary>
    static void QueueAtSchool()
    {
        int[] n_t = Utils.ReadIntArray();
        char[] line = Console.ReadLine().ToArray();
        for(int i = 0; i < n_t[1]; i++)
        {
            for(int j = 0; j < n_t[0]-1; j++)
            {
                if(line[j] == 'B' && line[j+1] == 'G')
                {
                    line[j] ='G';
                    line[j + 1] = 'B';
                    j++;
                }
            }
        }
        Console.WriteLine(String.Concat(line));

    }

}

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

namespace Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            long sum = n;
            for (int i = 0; i <= n; i++)
            {
                sum += (n - i) * i;
            }
            Console.WriteLine(sum);
            //Console.ReadLine();
        }
    }
}

using System;

namespace Application
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());

            int k = 0;

            for (int i = 1; i <= n-1; i++)
                k += (n - i) * i;

            Console.WriteLine(k+n);

        }
    }
}

using System;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            long a = long.Parse(System.Console.ReadLine());
            long b = 0;

            for (int i = 1; i <= a; ++i)
            {
                b += i * (1 + a - i) - (a - i);
            }

            System.Console.WriteLine(b);
        }
    }
}

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

namespace CodeForces_Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, j=0, n,sum=0;
            n = Convert.ToInt32(Console.ReadLine());
            for(i=0;i<n;i++)
            {
                for (j = 0; j < n; j++)
                    if (j + i == n)
                        sum = sum + (i * j);
            }
            Console.WriteLine(sum + n);
        }
    }
}

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

namespace ConsoleApplication22
{
    class Program
    {

        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int sum = n;
            for (int i = 1; i < n; i++)
            {
                sum += (n - i) * i;
            }
            Console.WriteLine(sum);
        }

    }
}

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

namespace rg
{
    class Program
    {
        static void Main(string[] args)
        {
            int n,i,k=0;

            n = int.Parse(Console.ReadLine());

            for(i=1;i<=n-1;i++)
            {
                k += ((n - i) * i) + 1;

            }

            Console.WriteLine(k+1);
        }
    }
}

using System;

namespace MainProgram
{

    class Program
    {
        static void Main(string[] args)
        {
           var n = int.Parse(Console.ReadLine());
           var result = 0;
            for(int i = 1; i < n; i++)
            {
                result += (n-i)*i;
            }
            result += n;
            Console.WriteLine (result);
        }
    }
}

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

namespace W0lf
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine()), f = 0;
            for(int i = 1; i < n; i++)
            {
                f += i * (n - i);
            }
            Console.WriteLine(f + n);
            Console.ReadLine();
        }
    }
}

using System;
class Program
    {
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            long result = n;
            result += (((n * n - n) / 2L) * n);
            result -= ((n * n - n) * (2 * n - 1L) / 6L);
            Console.WriteLine(result);
        }
    }

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

public class Program
{
	public static void Main()
	{
		int n=int.Parse(Console.ReadLine());
		int push=0;

		for(int i=1; i<=n; i++)
		{
			if(i==1)
			  push+=n;
			else if(i==n)
				push+=1;
			else
			{
				push+=(n-(i-1))+((n-i)*(i-1));
			}
		}
		Console.WriteLine(push);
	}
}

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

namespace Task
{
    internal class Program
    {

        private void Solve()
        {
            int n = io.NextInt();
            int ans = 0;
            for (int i = 0; i < n; i++)
            {
                ans += (n - i) * i;
                ans += 1;
            }
            io.Print(ans);
        }

        #region Program

        private readonly MyIo io;

        public Program(MyIo io)
        {
            this.io = io;
        }

        public static void Main(string[] args)
        {
            using (MyIo io = new MyIo())
            {
                new Program(io).Solve();
            }
        }

        #endregion
    }

    #region MyIo

    internal class MyIo : IDisposable
    {
        private readonly TextReader inputStream;
        private readonly TextWriter outputStream = Console.Out;

        private string[] tokens;
        private int pointer;

        public MyIo()
#if  LOCAL_TEST
            : this(new StreamReader("..\\..\\input.txt"))
#else
            : this(System.Console.In)
#endif
        {

        }

        public MyIo(TextReader inputStream)
        {
            this.inputStream = inputStream;
        }

        public string NextLine()
        {
            try
            {
                return inputStream.ReadLine();
            }
            catch (IOException)
            {
                return null;
            }
        }

        public string NextString()
        {
            try
            {
                while (tokens == null || pointer >= tokens.Length)
                {
                    tokens = NextLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                    pointer = 0;
                }
                return tokens[pointer++];
            }
            catch (IOException)
            {
                return null;
            }
        }

        public int NextInt()
        {
            return Next<int>();
        }

        public long NextLong()
        {
            return Next<long>();
        }

        public T Next<T>()
        {
            return (T)Convert.ChangeType(NextString(), typeof(T));
        }

        public IEnumerable<T> NextSeq<T>(int n)
        {
            for (int i = 0; i < n; i++)
                yield return Next<T>();
        }

        public void Print(string format, params object[] args)
        {
            outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));
        }

        public void PrintLine(string format, params object[] args)
        {
            Print(format, args);

            outputStream.WriteLine();
        }

        public void Print(bool o)
        {
            Print(o ? "YES" : "NO");
        }

        public void PrintLine(bool o)
        {
            PrintLine(o ? "YES" : "NO");
        }

        public void Print<T>(T o)
        {
            outputStream.Write(o);
        }

        public void PrintLine<T>(T o)
        {
            outputStream.WriteLine(o);
        }

        public void Close()
        {
            inputStream.Close();
            outputStream.Close();
        }

        void IDisposable.Dispose()
        {
            Close();

#if  LOCAL_TEST
            Console.ReadLine();
#endif
        }
    }

    #endregion
}

using System;

namespace New_task_93485
{
    class Program
    {
        static void Main(string[] args)
        {
            int Buttons = int.Parse(Console.ReadLine());
            int sum = 0;
            int tmp = Buttons;
            bool[,] arr = new bool[Buttons, Buttons];

            for(int i = 0; i < Buttons; i++)
            {
                arr[i, (Buttons-1) - i] = true;
            }
            bool check = true;

            for(int i = 0; i < Buttons; i++)
            {
                for(int j = 0; j < Buttons; j++)
                {
                    if (check)
                    {
                        check = false;
                        sum++;
                    }
                    else
                    {
                        sum += 1 * (i + 1);
                    }
                    if (arr[i, j])
                    {
                        check = true;
                        break;
                    }
                }

            }

            Console.WriteLine(sum);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int k = 1;
            int sum = 0;
            int c = n-1;
            while (k!=n)
            {
                sum += c * k;
                c--; k++;
            }
            Console.WriteLine(sum + n);
        }

    }
}

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

namespace _1000
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(new StreamReader("input.txt"));
            solve_164A();
        }

        public static void solve_164A()
        {
            int n = Convert.ToInt32(Console.ReadLine());

            int i = 2;
            int total = n;
            int len = n;
            while (--len > 1)
            {
                total += i * (len - 1);
                total += 1;
                i++;

            }
            total += n > 1 ? 1 : 0;

            Console.WriteLine(total);
        }

        public static void solve_betaRound9A()
        {
            string[] yw = Console.ReadLine().Split(' ');

            int y = Convert.ToInt32(yw[0]);
            int w = Convert.ToInt32(yw[1]);

            int diff = 6 - Math.Max(y, w) + 1;
            int numerator = diff == 4 ? 2 : diff == 5 ? 5 : 1;
            int nominator = 6 % diff == 0 ? 6 / diff : diff == 4 ? 3 : 6;
            Console.WriteLine("{0}/{1}", numerator, nominator);
        }

        public static void solve_531A()
        {
            long n = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine((n * (n + 1) / 2) % 2 == 0 ? 0 : 1);
        }

        /*
            The issue here is that you cannot easily calculate 2 to the power to 10000000.
            For that you need big arhithmetique techniques. And even this may not help
            because you need to quickly calculate powers of 2 and then you need to divide
            big integer by short integer values.
            But if you look into the problem you can actually observe that m
            can only give differnt reminders if it is less than n. If n is larger than m
            then you always have the reminder m. Furthermore, we can see by the problem
            statement that m can be maximum 8-digit number. So in order to calculate
            different reminders n must be less then 27). Why 27.
            Well, we know that (2^31) - 1 is the upper integer range int c#. And it is a 10
            digit number. Let't decrease 31 by 1 to see when we have an integer with 8 digits.
            Using calculator it's pretty easy.
         */
        public static void solve_hello2018A()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int answer = 0;
            if (n >= 27)
            {
                answer = m;
            }
            else
            {
                answer = m % Convert.ToInt32(Math.Pow(2, n));
            }

            Console.WriteLine(answer);
        }

        public static void solve_574B()
        {
            string[] nk = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(nk[0]);
            int k = Convert.ToInt32(nk[1]);

            int i = 1;
            int count = 1;
            while (i != n && i - count == k)
            {
                i++;
                count += count + 1;
            }

            Console.WriteLine(count);
        }

        public static void solve_574A()
        {
            string[] nk = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(nk[0]);
            int k = Convert.ToInt32(nk[1]);

            int[] cnt = new int[k];
            for (int i = 0; i < n; i++)
            {
                int p = Convert.ToInt32(Console.ReadLine());

                cnt[p - 1]++;
            }

            Array.Sort(cnt, (int a, int b) => b.CompareTo(a));
            int count = 0;
            int g = 0;
            int j = n % 2 > 0 ? n / 2 + 1 : n / 2;
            for (int i = 0; i < k; i++)
            {
                if (g >= j)
                {
                    break;
                }

                while (cnt[i] > 0 && g < j)
                {
                    int deduct = cnt[i] > 1 ? 2 : 1;
                    cnt[i] -= deduct;
                    count += deduct;
                    g += 1;
                }
                //int deduct = cnt[i] % 2 > 0 ? cnt[i] / 2 + 1 : cnt[i] / 2;
                /*if (j <= 0)
                {
                    break;
                }
                if (j == 1 && deduct > 1)
                {
                    count += 2;
                }
                else if (j == 1 && deduct == 1)
                {
                    count += 1;
                }
                else
                {
                    count += cnt[i];
                }

                j -= deduct;*/
            }

            Console.WriteLine(count);
        }

        public static void solve_352B()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string test = Console.ReadLine();
            int[] cnts = new int[123];

            for (int i = 0; i < n; i++)
            {
                cnts[test[i]]++;
            }

            int unq = 0;
            for (int i = 0; i < cnts.Length ;i++)
            {
                if (cnts[i] > 0)
                {
                    unq++;
                }
            }

            int answer = -1;

            //Redundancy in condition. if n must be <= 26 then of course unq will be <= 26. So we can remove it.
            if (unq <= 26 && n <= 26)
            {
                answer = n - unq;
            }

            Console.WriteLine(answer);
        }

        public static void solve_2A()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string[] test = Console.ReadLine().Split(' ');

            int max = int.MinValue;
            int maxI = 0;
            int min = int.MaxValue;
            int minI = 0;
            for (int i = 0; i < n; i++)
            {
                int num = Convert.ToInt32(test[i]);
                if (max < num)
                {
                    max = num;
                    maxI = i;
                }

                if (min > num)
                {
                    min = num;
                    minI = i;
                }
            }

            //n - 1 - because index starts at 0 and ends at n - 1
            // or we could add +1 to minI and maxI and count from 1.
            Console.WriteLine(Math.Abs(minI - maxI) + Math.Max(n - 1 - Math.Max(minI, maxI), Math.Min(minI, maxI)));
        }
        public static void solve_360B()
        {
            string n = Console.ReadLine();

            Console.WriteLine(n + String.Join("", n.Reverse().ToList()));
        }
    }
}

using System;
namespace _268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int sum = 0;
            for (int i = 1; i <= n; i++)
                if (i != n)
                    sum = sum + 1 + i * (n - i);
                else
                    sum++;
            Console.Write(sum);
        }
    }
}

using System;
using System.Linq;

namespace tren
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine()), count = 0;
            count += n;
            for (int i = 1; i <= n - 1; i++) count += (n - i) * i;
            Console.WriteLine(count);
        }
    }
}

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

namespace CF {
    class Program {

        static void Main(string[] args) {

            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

#if DEBUG
            TextReader reader = new StreamReader("../../input.txt");
            TextWriter writer = Console.Out;
#else
			TextReader reader = Console.In;
            TextWriter writer = Console.Out;
#endif

            var n = reader.Read<int>();

            long count = 0;
            int attempCost = 1;
            int knownLength = n;

            while (n > 1) {
                count += attempCost * (n - 1);
                attempCost++;
                n--;
            }
            count += knownLength;

            Console.WriteLine(count);

#if DEBUG
            Console.ReadKey();
#endif
        }

    }

    #region template
    class Pair<T1, T2> {
        public Pair(T1 first, T2 second) {
            First = first;
            Second = second;
        }
        public T1 First { get; set; }
        public T2 Second { get; set; }
        public override string ToString() {
            return "{" + First + " " + Second + "}";
        }

    }

    static class ReaderExtensions {

        public static string ReadToken(this TextReader reader) {
            int val;
            var builder = new StringBuilder();
            while (true) {
                val = reader.Read();
                if (val == ' ' || val == -1) {
                    if (builder.Length == 0) continue;
                    break;
                }
                if (val == 13) {
                    reader.Read();
                    if (builder.Length == 0) continue;
                    break;
                }
                builder.Append((char)val);
            }
            return builder.ToString();
        }

        public static T Read<T>(this TextReader reader) {
            return (T)Convert.ChangeType(reader.ReadToken(), typeof(T));
        }

        public static T[] ReadArr<T>(this TextReader reader) {
            return reader.ReadLine()
                .Split(' ').Select(str =>
                    (T)Convert.ChangeType(str, typeof(T))
                ).ToArray();
        }

    }

    static class LinqExtensions {
        /// <summary>Value / Index</summary>
        public static IEnumerable<Pair<T, int>> SelectIndexes<T>(this IEnumerable<T> collection) {
            return collection.Select((v, i) => new Pair<T, int>(v, i));
        }
        public static IEnumerable<T> SelectValues<T>(this IEnumerable<Pair<T, int>> collection) {
            return collection.Select(p => p.First);
        }
        public static void AddRepeatedRange<T, V>(this IDictionary<T, ICollection<V>> dictionary,
            Func<ICollection<V>> generator, IEnumerable<Pair<T,V>> sourceCollection ) {
            foreach (var pair in sourceCollection) {
                if (!dictionary.ContainsKey(pair.First)) {
                    dictionary[pair.First] = generator();
                }
                dictionary[pair.First].Add(pair.Second);
            }
        }
        public static T Second<T>(this IEnumerable<T> collection) {
            return collection.Skip(1).First();
        }
    }

    static class OutputExtensions {
        public static void WriteBySeparatorLine<T>(this IEnumerable<T> list, string sep = " ") {
            foreach (var v in list) {
                Console.Write(v);
                Console.Write(sep);
            }
            Console.WriteLine();
        }
    }

    #endregion
}

using System;

// Codeforces problem 268B "Кнопки"
// http://codeforces.com/problemset/problem/268/B
namespace _268_B
{
	class Program
	{
		static void Main(string[] args)
		{
			#region Read data
			int n = Convert.ToInt32(Console.ReadLine());
			#endregion
			#region Process data
			long result = n;
			for (int i = 1; i <= n; i++)
			{
				result += (n - i) * i;
			}
			#endregion
			#region Write results
			Console.WriteLine(result);
			Console.ReadLine();
			#endregion
		}
	}
}

using System;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int sum = 0;
            int buttonsFound = 0;
            for (int currentButton = n; currentButton > 0; currentButton--)
            {
                int numberOfAttemptsToFind = currentButton - 1;
                if (currentButton == 1)
                {
                    sum += n;
                }
                else
                {
                    sum += numberOfAttemptsToFind + (buttonsFound * numberOfAttemptsToFind);
                }
                buttonsFound++;
            }
            Console.WriteLine(sum);
        }
    }
}

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

namespace ConsoleApp74
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            long ans = 0;

            for (int i = n; i >= 1; i--)
            {
                ans += (n - i) * i;
                ans++;
            }
            Console.WriteLine(ans);
        }

    }

}

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

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = Int16.Parse(Console.ReadLine());
            int count = 0,sum=0;
            while (a != 1) {
                sum = sum + a + (a-1)*count;
                a--;
                count++;
            }
            Console.WriteLine(++sum);
            Console.ReadLine();
        }
    }
}

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

namespace ConsoleApplication236
{

    class Program
    {

        static void Main(string[] args)
        {
            ulong n = ulong.Parse(Console.ReadLine());
            ulong sum = 0;
            for (ulong i = 1; i <= n - 1; i++)
            {
                sum += (n - i) * i;
            }
            Console.WriteLine(sum + n);
        }
    }
}

namespace CodeForce164
{
    using System;
    using System.IO;

    public static class Program
    {
        public static void Main(string[] args)
        {
            ResolveB();
        }

        private static void ResolveB()
        {
#if DEBUG
            TextReader reader = new StreamReader(@"inputB.txt");
#else
            TextReader reader = Console.In;
#endif
            var n = int.Parse(reader.ReadLine());

            Console.WriteLine(ProblemB.Resolve(n));
        }
    }

    public static class ProblemB
    {
        public static int Resolve(int n)
        {
            int pressed = 0;
            int res = 0;
            while (n > 0)
            {
                int wrong = n - 1;
                res += wrong * (pressed + 1);
                res += 1;
                pressed += 1;
                n -= 1;
            }
            return res;
        }
    }
}

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

namespace Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            int buttons = Convert.ToInt32(Console.ReadLine());
            int count = 0;
            for (int i = 1; i < buttons; i++)
            {
                count += (buttons - i) * i;
            }
            Console.WriteLine(count + buttons);

        }

    }
}

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

namespace Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int res = n;
            int ops = 1;
            while (n > 1)
            {
                res += (n-1) * ops;
                n--;
                ops++;
            }
            Console.WriteLine(res);
        }
    }
}

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

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            /*  A

            int n = Convert.ToInt32(Console.ReadLine());
            int[,] A = new int[n, 2];

            for (int i = 0; i < n; i++)
            {
                string s = Console.ReadLine();
                string[] p = s.Split(new Char[] { ' ' });
                A[i, 0] = Convert.ToInt32(p[0]);
                A[i, 1] = Convert.ToInt32(p[1]);
            }
            int count = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (i != j)
                    {
                        if (A[i, 0] == A[j, 1])
                        {
                            count++;
                        }
                    }
                }
            }

            Console.WriteLine(count);
            */

            int n = Convert.ToInt32(Console.ReadLine());
            int x = 0;
            for (int i = 1; i <= n - 1; i++)
            {
                x += (n - i) * i;
            }
            x += n;
            Console.WriteLine(x);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Web;
using System.Net;

namespace ConsoleApplication1 {
    class Program {
        static void Main ( string[] args ) {
            int n = ReadInt();
            int count = n;
            for ( int i = 1; i < n; i++ )
                count += i * (n - i);

            Console.WriteLine( count );
        }

        static int _current = -1;
        static string[] _words = null;
        static int ReadInt () {
            if ( _current == -1 ) {
                _words = Console.ReadLine().Split( new char[] { ' ', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries );
                _current = 0;
            }

            int value = int.Parse( _words[ _current ] );
            if ( _current == _words.Length - 1 )
                _current = -1;
            else
                _current++;

            return value;
        }
    }
}

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

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());

        long res = 0;
        var c = 1;

        while (c<n)
        {
            res += (n - c)*c;
            c++;
        }

        Console.WriteLine(res+n);
    }
}

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

namespace NetExperiment
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int count = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n - i; j++)
                {
                    count += 1 + i;
                }
                count -= i;
            }
            Console.WriteLine(count);
        }
    }
}

using System;

namespace Application
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());

            int k = 0;

            for (int i = 1; i <= n-1; i++)
                k += (n - i) * i;

            Console.WriteLine(k+n);

        }
    }
}

using System;

namespace b268
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            string[] res = Console.ReadLine().Split (new char[]{' '});
            UInt64 n = Convert.ToUInt64(res[0]);
            UInt64 tot = 0;
            for (UInt64 i = 0; i < n; i++)
                tot += (n-i-1)*(i+1);

            tot += n;

            Console.WriteLine(tot);
        }
    }
}

using System;

namespace Zad1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Convert.ToInt32(Console.ReadLine());

            var res = 0;
            for (var i = n - 1; i >= 1; i--)
            {
                res += i * (n - 1 - i + 1);
            }
            res += n;
            Console.WriteLine(res);
        }
    }
}

using System;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine()), x = n, ans = n;

            if (n == 1)
            {
                Console.WriteLine("1");
            }
            else
            {
                for (int  p = 1; p < n; p++)
                {
                    ans += (x - 1) + p * (x - 2);
                    x--;
                }

                Console.WriteLine(ans++);
            }

            Console.Read();
        }
    }
}

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

public class App1
{
    public static void Main()
    {
        Func<string> read = ()=>Console.ReadLine();
        Action<object> write = _=>Console.WriteLine(_.ToString());

        long n=read().ToInt();
        write(n*(n+1)/2*(n-1)/3+n);
    }
}

static class Exts
{
    public static int ToInt(this string s)
    {
        return int.Parse(s);
    }
}

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

namespace probleme {
    class Program {
        static void Main(string[] args) {
            long n = long.Parse(Console.ReadLine());
            Console.Write(n * (n * n + 5) / 6);

            // Console.ReadKey();
        }
    }
}

using System;

namespace MainProgram
{

    class Program
    {
        static void Main(string[] args)
        {
           var n = int.Parse(Console.ReadLine());
           var result = 0;
            for(int i = 1; i < n; i++)
            {
                result += (n-i)*i;
            }
            result += n;
            Console.WriteLine (result);
        }
    }
}

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

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			int n = Int32.Parse(Console.ReadLine());
			int cnt = 0;
			for (int i = 1; i <= n; i++)
			{
				cnt += (n - i) * i;
			}
			cnt += n;
			Console.WriteLine(cnt);
		}
	}
}

using System;

namespace AlgoFun
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int counter = 2;

            int result = n + n - 1;
            for (int i = n - 2; i > 0; i--)
            {
                result += i * counter;
                counter++;
            }

            Console.WriteLine(result);
            Console.ReadLine();
        }
    }
}

using System;
namespace CS
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int counter = 0;
            for (int i = 1; i < n; i++)
                counter += (i * (n - i));
            Console.WriteLine(counter + n);
        }
    }
}

using System;
using System.Linq;

public class Buttons
{
	private static void Main()
	{
		var n = ReadInt();

		var result = n  > 1 ? n + 1 : 1;
		for (int i = 2; i <= n - 1; i++)
		{
			result += (i - 1) + (n - i) * (i - 1) + 1;
		}

		Console.WriteLine(result);
	}

	private static int[] ReadIntArray()
	{
		return Console.ReadLine().Split().Select(int.Parse).ToArray();
	}

	private static int ReadInt()
	{
		return int.Parse(Console.ReadLine());
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _1A
{
    class Program
    {
        static void Main(string[] args)
        {

            int n = int.Parse(Console.ReadLine());
            int ans = 0;
            for (int i = 0; i < n-1;i++)
            {
                ans = ans + (n - i) + (n - 1 - i) * i;
            }
                Console.WriteLine(ans+1);
           // Console.ReadKey();
        }

    }
}

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

namespace CSharpPrograms.Codeforces
{
    class _268B
    {
        static void Main()
        {
            long n = Convert.ToInt64(Console.ReadLine());
            long total = 0;
            for (int i = 1; i <= n; i++)
            {
                total += (n - (i - 1)) * (i - 1);
            }
            Console.WriteLine(total + n);
        }
    }
}

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

namespace CF_268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int cnt = 0;

            for (int i = 1; i < n; i++)
            {
                cnt += i*(n - i);
            }

            cnt += n;

            Console.WriteLine(cnt);
        }
    }
}

using System;

namespace CodeForce
{
    class _268B_Buttons
    {
        static void Main()
        {
            var buttonsAmount = int.Parse(Console.ReadLine());
            var result = buttonsAmount;

            for(var i = 1; i < buttonsAmount; i++)
            {
                result += i * (buttonsAmount - i);
            }

            Console.WriteLine(result);
        }
    }
}

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

namespace lALAL
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            long sum = 0;
            n = int.Parse(Console.ReadLine());
            for (int i = 1; i <= n-1; i++) sum += (long)i*(n-i);
            Console.WriteLine(sum+n);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Point : IComparable<Point>
    {
        public int a { get; set; }
        public int b { get; set; }

        public Point(int x, int y)
        {
            a = x;
            b = y;
        }

        public int CompareTo(Point other)
        {
            return this.a.CompareTo(other.a);
        }
    }
    class Program
    {

        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int sum = 0;

            if (n == 1) Console.WriteLine(1);
            else
            {
                for (int i = n; i >= 3; i--)
                {
                    sum += i;
                    for (int j = 0; j <= i-2; j++)
                    {
                        sum += j;
                    }
                }
                Console.WriteLine(sum+3);
            }
        }
    }
}

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

namespace CodeForces
{
    class R164_Div2_B
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            long cnt = 0;
            for (int i = 1; i <= n; i++)
                cnt += (n - i) * i + 1;

            Console.WriteLine(cnt);

        }
    }
}

using System;
class Program
    {
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            Console.WriteLine((n * n * n - n) / 6L+n);
        }
    }

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int k = 1;
            int sum = 0;
            int c = n-1;
            while (k!=n)
            {
                sum += c * k;
                c--; k++;
            }
            Console.WriteLine(sum + n);
        }

    }
}

using System;
using System.Collections.Generic;

namespace Olymp
{
    public class Program
    {
        static void Z1A ()
        {
            uint n, m, a;
            string str = Console.ReadLine ();
            string [] strs = str.Split (' ');
            n = UInt32.Parse (strs [0]);
            m = UInt32.Parse (strs [1]);
            a = UInt32.Parse (strs [2]);

            uint nn = n / a;
            if (n % a > 0)
                nn++;
            uint nm = m / a;
            if (m % a > 0)
                nm++;
            ulong result = (ulong)nn * (ulong)nm;
            Console.WriteLine (result);
        }

        static void Z4A ()
        {
            int w = Int32.Parse (Console.ReadLine ());
            if (w % 2 == 0 && w > 2)
                Console.WriteLine ("YES");
            else
                Console.WriteLine ("NO");
        }

        static void Z158A ()
        {
            int n, k;
            string [] strs = Console.ReadLine ().Split (' ');
            n = Int32.Parse (strs [0]);
            k = Int32.Parse (strs [1]);
            strs = Console.ReadLine ().Split (' ');
            int max = 0;
            int i;
            for (i = 0; i < k; i++) {
                max = Int32.Parse (strs [i]);
                if (max == 0) {
                    Console.WriteLine (i);
                    return;
                }
            }
            int sum = k;
            for (; i < n; i++) {
                if (Int32.Parse (strs [i]) < max)
                    break;
                sum++;
            }
            Console.WriteLine (sum);
        }

        static void Z71A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            string str;
            for (int i = 0; i < n; i++) {
                str = Console.ReadLine ();
                if (str.Length > 10) {
                    Console.WriteLine (str [0] + (str.Length - 2).ToString () + str [str.Length - 1]);
                } else {
                    Console.WriteLine (str);
                }

            }
        }

        static void Z118A ()
        {
            string str = Console.ReadLine ();
            str = str.ToLower ();
            str = str.Replace ("a", "");
            str = str.Replace ("o", "");
            str = str.Replace ("y", "");
            str = str.Replace ("e", "");
            str = str.Replace ("u", "");
            str = str.Replace ("i", "");
            for (int i = 0; i < str.Length; i++) {
                Console.Write ("." + str [i]);
            }

        }

        static void Z50A ()
        {

            string   [] strs = Console.ReadLine ().Split (' ');
            int N = Int32.Parse (strs [0]);
            int M = Int32.Parse (strs [1]);
            int result = 0;
            result = (N / 2) * M;
            N %= 2;
            M /= 2;
            result += M * N;
            Console.WriteLine (result);

        }

        static void Z158B ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            string[] strs = Console.ReadLine ().Split (' ');
            int[] com = new int[4];
            for (int i = 0; i < 4; i++) {
                com [i] = 0;
            }
            int temp = 0;
            for (int i = 0; i < n; i++) {
                temp = Int32.Parse (strs [i]);
                com [temp - 1]++;
            }
            int sum = com [3];
            temp = Math.Min (com [2], com [0]);
            com [2] -= temp;
            com [0] -= temp;
            sum += temp;
            sum += com [2];
            sum += com [1] / 2;
            com [1] %= 2;
            sum += com [1];
            com [0] -= com [1] * 2;
            if (com [0] > 0) {

                sum += com [0] / 4;
                com [0] %= 4;
                if (com [0] > 0)
                    sum++;
            }
            Console.WriteLine (sum);

        }

        static void Z231A ()
        {

            int n = Int32.Parse (Console.ReadLine ());
            string[] strs;
            int sum = 0;

            for (int i = 0; i < n; i++) {
                strs = Console.ReadLine ().Split (' ');
                if (Int32.Parse (strs [0]) + Int32.Parse (strs [1]) + Int32.Parse (strs [2]) > 1)
                    sum++;
            }
            Console.WriteLine (sum);
        }

        static void Z282A ()
        {

            int n = Int32.Parse (Console.ReadLine ());
            int x = 0;
            string str;
            for (int i = 0; i < n; i++) {
                str = Console.ReadLine ();
                str = str.Replace ("X", "");
                if (str == "++") {
                    x++;
                } else {
                    x--;
                }
            }
            Console.WriteLine (x);
        }

        static  void Z116A ()
        {

            int n = Int32.Parse (Console.ReadLine ());
            int a = 0, b = 0;
            int sum = 0;
            int max = 0;
            string [] strs;
            for (int i = 0; i < n; i++) {
                strs = Console.ReadLine ().Split (' ');
                a = Int32.Parse (strs [0]);
                b = Int32.Parse (strs [1]);
                sum -= a;
                sum += b;
                if (sum > max) {
                    max = sum;
                }
            }
            Console.WriteLine (max);
        }

        static void Z131A ()
        {
            bool caps = true;
            string str = Console.ReadLine ();
            char first = str [0];
            for (int i = 1; i < str.Length; i++) {
                if (str [i] < 'A' || str [i] > 'Z')
                    caps = false;
            }
            if (caps) {
                str = str.ToLower ();
                if (first >= 'a' && first <= 'z')
                    first = first.ToString ().ToUpper () [0];
                else
                    first = first.ToString ().ToLower () [0];
                str = first + str.Substring (1);

            }
            Console.WriteLine (str);
        }

        static void Z96A ()
        {
            string str = Console.ReadLine ();
            int n = 0;
            char ch = 'w';
            for (int i = 0; i < str.Length; i++) {
                if (ch == str [i])
                    n++;
                else {
                    if (n >= 7) {
                        Console.WriteLine ("YES");
                        return;
                    }
                    ch = str [i];
                    n = 1;
                }
            }
            if (n < 7)
                Console.WriteLine ("NO");
            else
                Console.WriteLine ("YES");
        }

        static void Z266A ()
        {

            string str = Console.ReadLine ();
            str = Console.ReadLine ();
            int n = 0;
            int m = 0;
            char ch = ' ';
            for (int i = 0; i < str.Length; i++) {
                if (ch == str [i])
                    n++;
                else {
                    m += n;
                    ch = str [i];
                    n = 0;
                }
            }
            m += n;
            Console.WriteLine (m);
        }

        static void Z133A ()
        {
            string str = Console.ReadLine ();
            for (int i = 0; i < str.Length; i++) {
                if (str [i] == 'H' || str [i] == 'Q' || str [i] == '9') {

                    Console.WriteLine ("YES");
                    return;
                }

            }
            Console.WriteLine ("NO");

        }

        static void Z112A ()
        {
            string str1 = Console.ReadLine ();
            str1 = str1.ToLower ();
            string str2 = Console.ReadLine ();
            str2 = str2.ToLower ();
            int n = String.Compare (str1, str2);
            if (n != 0)
                Console.WriteLine (n / Math.Abs (n));
            else
                Console.WriteLine (0);
        }

        static void Z339A ()
        {
            int [] ch = new int[3];
            for (int i = 0; i < 3; i++) {
                ch [i] = 0;
            }
            string str = Console.ReadLine ();
            bool flag = false;
            for (int i = 0; i < str.Length; i++) {
                if (flag)
                    i++;
                else
                    flag = true;
                ch [Int32.Parse (str [i].ToString ()) - 1]++;
            }
            int j = 0;
            flag = false;
            while (j<3) {
                ch [j]--;

                if (ch [j] >= 0) {
                    if (flag) {
                        Console.Write ("+");
                    } else
                        flag = true;
                    Console.Write (j + 1);
                } else
                    j++;
            }
        }

        static void Z281A ()
        {
            string str = Console.ReadLine ();
            string f = str [0].ToString ();
            f = f.ToUpper ();
            str = f [0] + str.Substring (1);
            Console.Write (str);
        }

        static void Z82A ()
        {
            string[] names = new    string[5];
            names [0] = "Sheldon";
            names [1] = "Leonard";
            names [2] = "Penny";
            names [3] = "Rajesh";
            names [4] = "Howard";
            int n = Int32.Parse (Console.ReadLine ());
            int m = 5;
            while (m<n) {
                n -= m;
                m *= 2;
            }
            m /= 5;
            int i = 0;
            while (m<n) {
                n -= m;
                i++;
            }
            Console.Write (names [i]);
        }

        static void Z160A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            string[] str = Console.ReadLine ().Split (' ');
            List<int> moneys = new List<int> ();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                moneys.Add (Int32.Parse (str [i]));
                sum += moneys [i];
            }

            int[] armon = moneys.ToArray ();
            Array.Sort (armon);
            int blz = 0;
            int j = armon.Length - 1;
            int ni = 0;
            while (blz<=sum&&j>=0) {
                blz += armon [j];
                sum -= armon [j];
                j--;
                ni++;
            }
            Console.WriteLine (ni);
        }

        static void Z148A ()
        {
            int k = Int32.Parse (Console.ReadLine ());
            int l = Int32.Parse (Console.ReadLine ());
            int m = Int32.Parse (Console.ReadLine ());
            int n = Int32.Parse (Console.ReadLine ());
            int d = Int32.Parse (Console.ReadLine ());
            int sum = 0;

            for (int i = 1; i <= d; i++) {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                    sum++;
            }
            Console.WriteLine (sum);
        }

        static void Z236A ()
        {
            string str = Console.ReadLine ();
            int n = 0;
            string ne = "";
            bool k;
            for (int i = 0; i < str.Length; i++) {
                k = false;
                for (int j = 0; j < ne.Length; j++) {
                    if (str [i] == ne [j]) {
                        k = true;
                    }
                }
                if (!k) {
                    ne += str [i];
                    n++;
                }
            }
            if (n % 2 == 0) {
                Console.WriteLine ("CHAT WITH HER!");
            } else {
                Console.WriteLine ("IGNORE HIM!");
            }
        }

        static int gdc (int left, int right)
        {
            while (left>0&&right>0) {
                if (left > right) {
                    left %= right;
                } else
                    right %= left;
            }
            return left + right;
        }

        static void Z119A ()
        {
            string[] str = Console.ReadLine ().Split (' ');
            int[] ab = new int[2];

            ab [0] = Int32.Parse (str [0]);
            ab [1] = Int32.Parse (str [1]);
            int n = Int32.Parse (str [2]);
            int i = 0;
            int m;
            while (true) {
                if (n == 0) {
                    Console.WriteLine ((i + 1) % 2);
                    return;
                }
                m = gdc (ab [i], n);
                n -= m;
                i = (i + 1) % 2;

            }

        }

        static void Z110A ()
        {
            string str = Console.ReadLine ();
            int n = 0;
            for (int i = 0; i < str.Length; i++) {
                if (str [i] == '4' || str [i] == '7') {
                    n++;
                }
            }
            if (n == 4 || n == 7) {
                Console.WriteLine ("YES");
            } else {
                Console.WriteLine ("NO");
            }
        }

        static void Z467A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            int res = 0;
            string [] strs;
            for (int i = 0; i < n; i++) {
                strs = Console.ReadLine ().Split (' ');
                if (Int32.Parse (strs [1]) - Int32.Parse (strs [0]) >= 2) {
                    res++;
                }
            }
            Console.WriteLine (res);
        }

        static void Z271A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            int [] ye = new int[4];
            n++;
            for (int i = 0; i < 4; i++) {
                ye [i] = n / 1000;
                n %= 1000;
                n *= 10;
            }
            bool flag = true;
            while (flag) {
                for (int i = 0; i < 4; i++) {
                    for (int j = 0; j < i; j++) {
                        if (ye [i] == ye [j]) {
                            ye [i]++;

                            for (int k = i+1; k < 4; k++) {
                                ye [k] = 0;
                            }
                            i--;
                        }
                    }
                }
                flag = false;
                for (int i = 1; i < 4; i++) {
                    if (ye [i] == 10) {
                        ye [i] %= 10;
                        ye [i - 1]++;
                        flag = true;
                    }
                }
            }
            for (int i = 0; i < 4; i++) {
                Console.Write (ye [i]);
            }

        }

        static void Z58A ()
        {
            string str = Console.ReadLine ();
            str.ToLower ();
            string sstr = "hello";
            int j = 0;
            for (int i = 0; i < str.Length; i++) {
                if (sstr [j] == str [i])
                    j++;
                if (j == sstr.Length) {
                    Console.WriteLine ("YES");
                    return;
                }
            }
            Console.WriteLine ("NO");
        }

        static void Z472A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            if (n % 2 == 0) {
                Console.Write ("4 ");
                Console.Write (n - 4);
            } else {
                Console.Write ("9 ");
                Console.Write (n - 9);
            }
        }

        static void Z460A ()
        {
            int res = 0;
            int days = 0;
            string[] strs = Console.ReadLine ().Split (' ');
            int nosk = Int32.Parse (strs [0]);
            int nd = Int32.Parse (strs [1]);
            while (nosk!=0) {
                days += nosk;
                res += nosk;
                nosk = 0;
                nosk = days / nd;
                days %= nd;
            }
            Console.Write (res);
        }

        static void Z379A ()
        {
            string[] strs = Console.ReadLine ().Split (' ');
            int a = Int32.Parse (strs [0]);
            int b = Int32.Parse (strs [1]);
            int ogaroks = 0;
            int h = 0;
            while (a!=0) {
                h += a;
                ogaroks += a;
                a = ogaroks / b;
                ogaroks %= b;
            }
            Console.WriteLine (h);
        }

        static bool IsLucky (int n)
        {
            while (n>0) {
                int m = n % 10;
                if (m != 4 && m != 7) {
                    return false;
                }
                n /= 10;
            }
            return true;
        }

        static void Z122A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            for (int i = 2; i <= n; i++) {
                if (n % i == 0 && IsLucky (i)) {
                    Console.WriteLine ("YES");
                    return;
                }
            }
            Console.WriteLine ("NO");
        }

        static void Z136A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            int[] pod = new int[n];
            string[] strs = Console.ReadLine ().Split (' ');
            for (int i = 0; i < n; i++) {
                pod [Int32.Parse (strs [i]) - 1] = i + 1;
            }
            for (int i = 0; i < n; i++) {
                Console.Write (pod [i].ToString () + " ");
            }
        }

        static void Z228A ()
        {
            string[] strs = Console.ReadLine ().Split (' ');
            List<int> n = new List<int> ();
            for (int i = 0; i < 4; i++) {
                bool flag = true;
                for (int j = 0; j < n.Count; j++) {
                    if (Int32.Parse (strs [i]) == n [j]) {
                        flag = false;
                        break;
                    }
                }
                if (flag) {
                    n.Add (Int32.Parse (strs [i]));
                }
            }
            Console.WriteLine (4 - n.Count);
        }

        static void Z263A ()
        {
            string[] strs;
            int x = 0, y = 0;
            for (int i = 0; i < 5; i++) {
                strs = Console.ReadLine ().Split (' ');
                for (int j = 0; j < 5; j++) {
                    if (strs [j] == "1") {
                        x = j + 1;
                        y = i + 1;
                    }
                }

            }
            Console.WriteLine ((Math.Abs (3 - x) + Math.Abs (3 - y)));
        }

        static void Z266B ()
        {
            string[] strs = Console.ReadLine ().Split (' ');
            int n = Int32.Parse (strs [0]);
            int t = Int32.Parse (strs [1]);
            string str = Console.ReadLine ();
            char[] chs = new char[str.Length];
            for (int i = 0; i < str.Length; i++) {
                chs [i] = str [i];
            }
            for (int i = 0; i < t; i++) {
                int j = 0;
                while (j+1<n) {
                    if (chs [j] == 'B' && chs [j + 1] == 'G') {
                        char ch = chs [j];
                        chs [j] = chs [j + 1];
                        chs [j + 1] = ch;
                        j += 2;
                    } else {
                        j++;
                    }
                }
            }
            for (int i = 0; i < chs.Length; i++) {
                Console.Write (chs [i]);
            }

        }

        static void Z41A ()
        {
            string str1 = Console.ReadLine ();
            string str2 = Console.ReadLine ();
            if (str1.Length != str2.Length) {
                Console.WriteLine ("NO");
                return;
            }
            for (int i = 0; i < str1.Length; i++) {
                if (str1 [i] != str2 [str2.Length - i - 1]) {

                    Console.WriteLine ("NO");
                    return;
                }
            }
            Console.WriteLine ("YES");
        }

        static void Z144A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            string[] strs = Console.ReadLine ().Split (' ');
            int[] rost = new int[n];
            int max = 0;
            int min = n - 1;
            for (int i = 0; i < n; i++) {
                rost [i] = Int32.Parse (strs [i]);
                if (rost [i] > rost [max])
                    max = i;
            }
            int sum = 0;
            while (max!=0) {
                int temp = rost [max];
                rost [max] = rost [max - 1];
                rost [max - 1] = temp;
                sum++;
                max--;
            }

            for (int i = n-1; i >=0; i--) {

                if (rost [i] < rost [min]) {
                    min = i;
                }
            }
            while (min!=rost.Length-1) {
                int temp = rost [min];
                rost [min] = rost [min + 1];
                rost [min + 1] = temp;
                sum++;
                min++;
            }
            Console.WriteLine (sum);
        }

        static void Z451A ()
        {
            string[] names = new string[2];
            names [0] = "Akshat";
            names [1] = "Malvika";
            string[] strs = Console.ReadLine ().Split (' ');
            int n = Int32.Parse (strs [0]);
            int m = Int32.Parse (strs [1]);
            n = Math.Min (n, m) - 1;
            n %= 2;
            Console.WriteLine (names [n]);

        }

        static void Z344A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            int ostr = 1;
            string str = Console.ReadLine ();
            char ch = str [1];
            for (int i = 1; i < n; i++) {
                str = Console.ReadLine ();
                if (ch == str [0]) {
                    ostr++;
                }
                ch = str [1];
            }
            Console.WriteLine (ostr);
        }

        static void Z486A ()
        {
            long n = Int64.Parse (Console.ReadLine ());
            long sum = n / 2;
            sum -= (n % 2) * n;
            Console.WriteLine (sum);
        }

        static void Z500A ()
        {
            string[] str = Console.ReadLine ().Split (' ');
            int n = Int32.Parse (str [0]);
            int t = Int32.Parse (str [1]);
            int[] a = new int[n - 1];
            str = Console.ReadLine ().Split (' ');
            int j = 0;
            t--;
            for (int i = 0; i < n-1; i++) {
                a [i] = Int32.Parse (str [i]);
                if (i == j)
                    j += a [i];
                if (j >= t)
                    break;
            }
            if (j == t)
                Console.WriteLine ("YES");
            else
                Console.WriteLine ("NO");
        }

        static void Z61A ()
        {
            string str1 = Console.ReadLine ();
            string str2 = Console.ReadLine ();
            string str3 = "";
            for (int i = 0; i < str1.Length; i++) {
                if (str1 [i] == str2 [i])
                    str3 += "0";
                else
                    str3 += "1";
            }
            Console.WriteLine (str3);
        }

        static void Z268A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            int[] h = new int[n];
            int[] a = new int[n];
            string[] strs;
            for (int i = 0; i < n; i++) {
                strs = Console.ReadLine ().Split (' ');
                h [i] = Int32.Parse (strs [0]);
                a [i] = Int32.Parse (strs [1]);
            }
            int sum = 0;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if (i != j && h [i] == a [j])
                        sum++;
                }
            }
            Console.WriteLine (sum);
        }

        static void Z208A ()
        {
            string str = Console.ReadLine ();
            string[] separ = new string[1];
            separ [0] = "WUB";
            string[] strs = str.Split (separ, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < strs.Length; i++) {
                Console.Write (strs [i] + " ");
            }
        }

        static void Z478A ()
        {
            string []strs=Console.ReadLine().Split(' ');
            int n=0;
            for (int i = 0; i < 5; i++) {
                n+=Int32.Parse(strs[i]);
            }
            if (n%5==0&&n!=0) {
                Console.WriteLine(n/5);
            }
            else {
                Console.WriteLine(-1);
            }
        }
        static void Z69A ()
        {
            int n = Int32.Parse (Console.ReadLine ());
            int x = 0, y = 0, z = 0;
            string[] strs;
            for (int i = 0; i < n; i++) {
                strs = Console.ReadLine ().Split (' ');
                x += Int32.Parse (strs [0]);
                y += Int32.Parse (strs [1]);
                z += Int32.Parse (strs [2]);
            }
            if (x == 0 && y == 0 && z == 0) {
                Console.Write ("YES");
            } else {
                Console.Write("NO");
            }
        }
        static void Z337A ()
        {
            string[] strs=Console.ReadLine().Split(' ');
            int n=Int32.Parse(strs[0]);
            int m=Int32.Parse(strs[1]);
            List<int> arra=new List<int>();
            strs=Console.ReadLine().Split(' ');
            bool flag;
            for (int i = 0; i < m; i++) {
                flag=true;
                int t=Int32.Parse(strs[i]);
                for (int j = 0; j < arra.Count; j++) {
                    if(t<arra[j])
                    {
                        arra.Insert(j,t);
                        flag=false;
                        break;
                    }
                }
                if (flag) {
                    arra.Add(t);
                }
            }
            int min=int.MaxValue;
            for (int i = n-1; i < arra.Count; i++) {
                if (arra[i]-arra[i-n+1]<min) {

                    min=arra[i]-arra[i-n+1];
                }
            }
            Console.Write(min);
        }
        static void Z141A ()
        {
            string names = Console.ReadLine ();
            names += Console.ReadLine ();
            string str = Console.ReadLine ();
            if (names.Length != str.Length) {
                Console.Write ("NO");
                return;
            }
            bool flag;
            for (int i = 0; i < str.Length; i++) {
                flag=true;;
                for (int qj = 0; qj < names.Length; qj++) {
                    if (str[i]==names[qj]) {
                        flag=false;
                        names=names.Substring(0,qj)+' '+names.Substring(qj+1);
                        break;
                    }
                }
                if (flag) {
                    Console.WriteLine("NO");
                    return;
                }
            }
            Console.WriteLine("YES");
        }
        static void Z492A ()
        {
            int n=Int32.Parse(Console.ReadLine());
            int i=1;
            int level=0;
            int sum=1;
            while (n>=sum) {
                level++;
                n-=sum;
                i++;
                sum+=i;
            }
            Console.WriteLine(level);
        }
        static void Z479A ()
        {
            int a=Int32.Parse(Console.ReadLine());
            int b=Int32.Parse(Console.ReadLine());
            int c=Int32.Parse(Console.ReadLine());
            int res=a+b+c;
            res=Math.Max(res,(a+b)*c);
            res=Math.Max(res,a*(b+c));
            res=Math.Max(res,(a*b)*c);
            Console.WriteLine(res);

        }
        static void Z448A ()
        {
            string[] strs = Console.ReadLine ().Split (' ');
            int a = Int32.Parse (strs [0]) + Int32.Parse (strs [1]) + Int32.Parse (strs [2]);
            strs = Console.ReadLine ().Split (' ');
            int b = Int32.Parse (strs [0]) + Int32.Parse (strs [1]) + Int32.Parse (strs [2]);
            int n = Int32.Parse (Console.ReadLine ());
            int aa = a / 5;
            if (a % 5 != 0) {
                aa++;
            }
            n -= aa;
            if (n < 0) {
                Console.WriteLine("NO");
                return;
            }
            aa=b/10;
            if (b%10!=0) {
                aa++;
            }
            n -= aa;
            if (n < 0) {
                Console.WriteLine("NO");
                return;
            }
            Console.WriteLine("YES");
        }
        static  void Z469A ()
        {
            int n=Int32.Parse(Console.ReadLine());
            bool[]levels=new bool[n];
            for (int i = 0; i < n; i++) {
                levels[i]=true;
            }
            for (int i = 0; i < 2; i++) {
                string[]str=Console.ReadLine().Split(' ');
                int m=Int32.Parse(str[0]);
                for (int j = 1; j <= m; j++) {
                    levels[Int32.Parse(str[j])-1]=false;
                }
            }
            for (int i = 0; i < n; i++) {
                if (levels[i]) {
                    Console.WriteLine("Oh, my keyboard!");
                    return;
                }
            }
            Console.WriteLine("I become the guy.");
        }
        static void Z155A ()
        {
            int n=Int32.Parse(Console.ReadLine());
            string[]strs=Console.ReadLine().Split(' ');
            int max=Int32.Parse(strs[0]);
            int min=max;
            int m=0;
            for (int i = 1; i < n; i++) {
                int t=Int32.Parse(strs[i]);
                if (t>max) {
                    m++;
                    max=t;
                }
                if (t<min) {
                    m++;
                    min=t;
                }
            }
            Console.WriteLine(m);
        }
        static void Z443A ()
        {
            string str=Console.ReadLine();
            int i=1;
            List<char> chrs=new List<char>();
            bool flag;
            while (str[i]!='}') {

                flag=true;
                for (int j = 0; j < chrs.Count; j++) {
                    if (str[i]==chrs[j]) {
                        flag=false;
                        break;
                    }
                }
                if (flag) {
                    chrs.Add(str[i]);
                }
                i++;
                if(str[i]=='}')
                    break;
                i+=2;
            }
            Console.WriteLine(chrs.Count);
        }
        static void Z474A ()
        {
            char[,]keyboard=new char[3,10];
            keyboard[0,0]='q';
            keyboard[0,1]='w';
            keyboard[0,2]='e';
            keyboard[0,3]='r';
            keyboard[0,4]='t';
            keyboard[0,5]='y';
            keyboard[0,6]='u';
            keyboard[0,7]='i';
            keyboard[0,8]='o';
            keyboard[0,9]='p';
            keyboard[1,0]='a';
            keyboard[1,1]='s';
            keyboard[1,2]='d';
            keyboard[1,3]='f';
            keyboard[1,4]='g';
            keyboard[1,5]='h';
            keyboard[1,6]='j';
            keyboard[1,7]='k';
            keyboard[1,8]='l';
            keyboard[1,9]=';';
            keyboard[2,0]='z';
            keyboard[2,1]='x';
            keyboard[2,2]='c';
            keyboard[2,3]='v';
            keyboard[2,4]='b';
            keyboard[2,5]='n';
            keyboard[2,6]='m';
            keyboard[2,7]=',';
            keyboard[2,8]='.';
            keyboard[2,9]='/';
            bool flag;
            string lr=Console.ReadLine();
            string str=Console.ReadLine();
            int[]x=new int[str.Length];
            int[]y=new int[str.Length];
            for (int i = 0; i < str.Length; i++) {
                flag=false;
                for (int k = 0; k < 3; k++) {
                    for (int m = 0; m < 10; m++) {
                        if (keyboard[k,m]==str[i]) {
                            y[i]=k;
                            x[i]=m;
                            flag=true;
                            break;
                        }
                    }
                    if(flag)
                        break;
                }
            }
            int a=0;
            if (lr=="L") {
                a++;
            }
            else {
                a--;
            }
            for (int i = 0; i < str.Length; i++) {
                Console.Write(keyboard[y[i],x[i]+a]);
            }
        }
        static void Z268B ()
        {
            int n=Int32.Parse(Console.ReadLine());
            int sum=0;
            for (int j = 1; j < n; j++) {
                sum+=(n-j)*j;
            }
            sum+=n;
            Console.WriteLine(sum);
        }
        public static void Main ()
        {

            Z268B ();
        }

    }
}

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

namespace Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            int buttons = Convert.ToInt32(Console.ReadLine());
            int count = 0;
            for (int i = 1; i < buttons; i++)
            {
                count += (buttons - i) * i;
            }
            Console.WriteLine(count + buttons);

        }

    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static int[] ReadInt(int size)
        {
            string[] input = Console.ReadLine().Split(' ');
            int[] res = new int[size];
            for (int i=0; i<input.Length; i++)
            {
                res[i] = Convert.ToInt32(input[i]);
            }
            return res;
        }

        static int ReadInt()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            return n;
        }

        static void ReadInt(out int a, out int b)
        {
            int[] input = ReadInt(2);
            a = input[0];
            b = input[1];
        }

        static void ReadInt(out int a, out int b, out int c)
        {
            int[] input = ReadInt(3);
            a = input[0];
            b = input[1];
            c = input[2];
        }

        static void ReadInt(out int a, out int b, out int c, out int d)
        {
            int[] input = ReadInt(4);
            a = input[0];
            b = input[1];
            c = input[2];
            d = input[3];
        }

        static String ReadString()
        {
            return Console.ReadLine();
        }

        static int Max(int a, int b)
        {
            return (a > b ? a : b);
        }

        static void WL<T> (T s)
        {
            Console.WriteLine(s);
        }

        static void swap(ref int a, ref int b)
        {
            int temp = a;
            a = b;
            b = temp;
        }

        static void Main(string[] args)
        {
            int n = ReadInt();
            int sum = n;
            for (int i = 1; i <= n; i++) sum += i * (n - i);
            WL(sum);
        }
    }
}

using System;

namespace codeforces
{
    class Program
    {

        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int count = n, ch = n;
            if (n == 1)
                count = 1;
            else if (n == 2)
                count = 3;
            else
            {
                if (n % 2 != 0)
                {

                    int max = ((n - 1) / 2);
                    for (int i = 1; i < max; i++)
                        count += ch = ch + 2 * (max - i);
                    count *= 2;
                    count += 1;
                }
                else
                {

                    int max = (n / 2 - 1);
                    for (int i = 1; i < max; i++)
                        count += ch = ch + 2 * (max - i) + 1;
                    count *= 2;
                    count += ch + 1 + 1;

                }
            }

            Console.WriteLine(count);

        }
    }
}

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

namespace B_Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            int.TryParse(Console.ReadLine(), out int n);

            int result = 0;
            for(int i = 0; i < n; i++)
            {
                result += (i * (n - i) + 1);
            }

            Console.WriteLine(result);
            Console.ReadLine();
        }
    }
}

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

namespace cf_164_2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int s = n;
            for (int i = 1; i <= n-1; i++)
            {
                s += i*(n - i);
            }
            Console.WriteLine(s);
        }
    }
}

using System;

namespace q268b
{
    class Program
    {
        static void Main(string[] args)
        {
	    var inputFirstLine = int.Parse(Console.ReadLine());
	    var totalPressing = 0;
	    var pressingBack = 0;

	    var n = inputFirstLine;

	    for (var depth = 0; depth < n; depth++)
	    {
		totalPressing += (n - depth - 1) * pressingBack; // 실패시 반복될 되누름수
		totalPressing += (n - depth - 1); // 실패하기 위해 눌렀던 누름수
		totalPressing += 1; // 성공적인 마지막 누름
		pressingBack += 1; // 여기서부터 실패하면 다시 누르기 위해 성공적인 스텝을 반복해야함
	    }

	    Console.WriteLine(totalPressing);
        }
    }
}

using System;

namespace AllProblems
{
    class Program
    {
        static void Main(string[] args)
        {
            _268B_Buttons.Run();

        }
    }
    class _268B_Buttons
    {
        public static void Run()
        {
            var n = int.Parse(Console.ReadLine());
            if (n == 1)
            {
                Console.WriteLine(1);
                return;
            }

            var ctr = n + 1;

            for (var i = 1; i < n-1; i++)
            {
                ctr = ctr + (n - i)*i + 1;
            }

            Console.WriteLine(ctr);
            Console.ReadLine();

        }
    }
}

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

namespace Fun
{
	class Program
	{
		static void Main(string[] args)
		{
			var n = int.Parse(Console.ReadLine());
			int c = 0;
			for (int i = 1; i < n; i++)
				c += i * (n - i);
			Console.WriteLine(c + n);
		}
	}
}

using System;

class B268 {
    public static void Main() {
        var n = long.Parse(Console.ReadLine());
        Console.WriteLine(n * (n * n + 5) / 6);
    }
}

using System;

namespace CodeForce
{
    class _268B_Buttons
    {
        static void Main()
        {
            var buttonsAmount = int.Parse(Console.ReadLine());
            var result = buttonsAmount;

            for(var i = 1; i < buttonsAmount; i++)
            {
                result += i * (buttonsAmount - i);
            }

            Console.WriteLine(result);
        }
    }
}

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

namespace CF_286B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int ans = 0;
            for (int i = 0; i < n ; ++i)
            {
                ans += i * (n - i);
            }
            Console.WriteLine(ans+n);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            long[] temp = new long[n];
            for (int i = 0; i < n; i++)
                temp[i] = n;
            long sum = 0;
            for (int i = n - 1; i > 0; i--)
                sum += i * (n - i);
            sum += n;
            Console.WriteLine(sum);
            //3 (find 1)
            //2*2(find 2)
            //3*1(find 3)
            //4
        }
    }
}

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

namespace ProjectEuler
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = Convert.ToInt64(Console.ReadLine());
            Console.WriteLine(n*(n*n + 5)/6);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int s=n-1;

            for (int k=1; k<n; k++)
            {
                s += k;
                s += k * (n - k - 1);
            }
            s++;
            Console.WriteLine(s);
        }
    }
}

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

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int res = 0;
            for (int i = 1; i <= n; i++)
                res += (n - i) * i;
            res += n;
            Console.WriteLine(res);
        }
    }
}

using System;
class CFR164D2B
{
	static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		int res = 0;
		for (int i = n; i > 0; i--)
		{
			res += i;
			if (i > 1) res += (n - i) * (i - 1);
		}
		Console.WriteLine(res);
	}
}

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

namespace CF_268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int cnt = 0;

            for (int i = 1; i < n; i++)
            {
                cnt += i*(n - i);
            }

            cnt += n;

            Console.WriteLine(cnt);
        }
    }
}

using System;

namespace _268B
{
	class Program
	{
		static void Main ( string [ ] args )
		{
			short n = short.Parse( Console.ReadLine() ), pressed = 1;
			int c = n;
			while ( n - pressed > 0 )
			{
				c += ( ( n - pressed - 1 ) * pressed + ( n - pressed ) );
				++pressed;
			}
			Console.Write( c );
		}
	}
}

using System;
 public class Program
    {
        public static void Main(string[] args)
        {
            long input = long.Parse(Console.ReadLine());
            long result = input - 1l;
            long half = input / 2l;
            for (long i = 2l; i <= half; ++i) result += i * (input - i);
            result *= 2l;
            if (input % 2l == 1l) result += half*(half + 1l);
            Console.WriteLine((result + 1l));
        }
    }

using System;

// Codeforces problem 268B "Кнопки"
// http://codeforces.com/problemset/problem/268/B
namespace _268_B
{
	class Program
	{
		static void Main(string[] args)
		{
			#region Read data
			int n = Convert.ToInt32(Console.ReadLine());
			#endregion
			#region Process data
			long result = 1;
			for (int i = 2; i <= n; i++)
			{
				result *= i;
			}
			result++;
			#endregion
			#region Write results
			Console.WriteLine(result);
			Console.ReadLine();
			#endregion
		}
	}
}

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

namespace rg
{
    class Program
    {
        static void Main(string[] args)
        {
            int n,f=1;

            n = int.Parse(Console.ReadLine());
            if (n == 1) Console.WriteLine('1');
            while(n>1)
            {
                f *= n;
                n--;
            }
            Console.WriteLine(f + 1);
        }

    }

}

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

namespace ConsoleApplication2
{
    class Program
    {

        static void Main(string[] args)
        {
            int n;
            n = Convert.ToInt32(Console.ReadLine());
            int hasil = 0;
            for (int i = 0; i < n; i++)
            {
                if (i == 0)
                {
                    hasil = hasil + n;
                }
                else if (i == n - 1)
                {
                    hasil = hasil + n;
                }
                else if (i == n - 2)
                {
                    hasil = hasil + 1;
                }
                else
                {
                    hasil = hasil + n - i + n - i - 1;
                }
            }

            if (n == 2)
            {
                Console.WriteLine("3");
            }
            else
            {
                Console.WriteLine(hasil);
            }
                Console.ReadLine();
        }
    }
}

using System;

namespace MainProgram
{

    class Program
    {
        static void Main(string[] args)
        {
           var counter = int.Parse(Console.ReadLine());
           long factorial = counter;
           while (counter > 1)
              factorial *= --counter;
           Console.WriteLine(factorial + 1);
        }
    }
}

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

public class Program
{
	public static void Main()
	{
		int n=int.Parse(Console.ReadLine());
		int push=0;

		for(int i=1; i<=n; i++)
		{
			if(i==1)
			  push+=n;
			else if(i==n)
				push+=1;
			else
			{
				push+=(n-i)*(i-1);
			}
		}
		Console.WriteLine(push);
	}
}

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

public class Program
{
	public static void Main()
	{
		int n=int.Parse(Console.ReadLine());
		int push=0;

		for(int i=1; i<=n; i++)
		{
			if(i==1)
			  push+=n;
			else if(i==n)
				push+=1;
			else
			{
				push+=2*n-i-1;
			}
		}
		Console.WriteLine(push);
	}
}

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

public class Program
{
	public static void Main()
	{
		int n=int.Parse(Console.ReadLine());
		int push=0;

		for(int i=1; i<=n; i++)
		{
			if(i==1)
			  push+=n;
			else if(i==n)
				push+=1;
			else
			{
				push+=n;
			}
		}
		Console.WriteLine(push);
	}
}

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

namespace CF_268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(n*n-n+1);
        }
    }
}

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

namespace _268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int sum = 0;

            for (int i = 1; i <= n; i++)
            {
                sum += i;
            }

            if (n <= 2)
            {
                Console.Write(sum);
            }
            else
            {
                Console.Write(sum + 1);
            }

            Console.ReadLine();

        }
    }
}

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

namespace _268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int sum = 0;
            if (n == 1)
            {
                sum = 1;
            }
            else
            {
                sum = (int)Math.Pow(2, n) - (n / 2);
            }

            Console.Write(sum);
            Console.ReadLine();
        }
    }
}

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

namespace Codeforces
{
    class _268B
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int s = 0;
            for (int i = 1; i < n; i++)
                s = s + i * (n - (i - 1) * 2) + 1;
            Console.WriteLine(s);
        }
    }
}

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

namespace ConsoleApplication22
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int count = 0; int l = n;

            string output = string.Join("", Enumerable.Range(1, n).Reverse());
            if (n == 1) { Console.WriteLine(1);  return; }
            while(n > 0)
            {
                count += n;
                n--;
            }

            count += (int)Math.Pow( (l-2) , 2 );

            Console.WriteLine(count);
        }
        // 1,2,3         1,2(2)   3(3)  3,3(4) 3,1(5) 3,2(6) 3,2,1

        private static IEnumerable<string> Perms(string source)
        {
            if (source.Length == 1) return new List<string>() { source };

            var perm = from l in source
                       from _x in Perms(string.Join("",
source.Where(x => x != l)
))
                       select l + _x; ;
            return perm;
        }
    }
}

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

namespace ConsoleApplication22
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int count = 0;

            count = Enumerable.Range(1, n).Aggregate((x, y) => x * y) + 1;

            Console.WriteLine(count);
        }

        private static IEnumerable<string> Perms(string source)
        {
            if (source.Length == 1) return new List<string>() { source };

            var perm = from l in source
                       from _x in Perms(string.Join("",
source.Where(x => x != l)
))
                       select l + _x; ;
            return perm;
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int s=0;

            for (int k=1; k<n; k++)
            {
                s += n - k;
                s += k;
            }
            s++;
            Console.WriteLine(s);
        }
    }
}

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

namespace ProjectEuler
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine(n*(n*n + 5)/6);
        }
    }
}

using System;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            long a = long.Parse(System.Console.ReadLine());
            long b = 2;

            for (int i = 2; i <= a; ++i)
            {
                b -= 1;
                b += i * (1 + a - i);
            }

            System.Console.WriteLine(b);
        }
    }
}

using System;

namespace B {
    internal class Program {
        private static void Main() {
            var n = Convert.ToInt32(Console.ReadLine());
            var a = new int[n+4];
            a[1] = 1;
            a[2] = 3;
            for (int i = 3; i <= n; i++) {
                a[i] = a[i - 1]*2 + 1;
            }

            Console.WriteLine(a[n]);
        }
    }
}

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

namespace codeforces
{
    class Program
    {

        static void Main(string[] args)
        {
            int a = Int16.Parse(Console.ReadLine()),sum=a;
            for (int i = a; i > 0; i--) {
                sum = sum + ((i-1)*2);
            }
            Console.WriteLine(sum-(a-1));
            Console.ReadLine();
        }
    }
}

/*
 * Сделано в SharpDevelop.
 * Пользователь: alexey
 * Дата: 16.11.2012
 * Время: 19:15
 *
 * Для изменения этого шаблона используйте Сервис | Настройка | Кодирование | Правка стандартных заголовков.
 */
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Threading;
using System.IO;
using System;

namespace round_159
{
    class Program
    {
        public static int ReadInt(){

                return int.Parse(Console.ReadLine());

            }

        public static string[] ReadStrArr(){

                return Console.ReadLine().Split(' ');

            }

        public static int ToInt(Object a){

            return int.Parse(a.ToString());

            }

        public static void print(object[] mas){

        for (int i =0;i<mas.Length;i++)
            Console.Write(mas[i].ToString()+" ");
        }

    public static void Main(string[] args)
        {

        int n  = ReadInt();

        int[,] dp = new int[n,n];
        for(int i =0;i<n;i++) {
            dp[0,i] = 1;
            dp[i,0] =1;
        }

        int ans=2*n-1;
        for(int i =1;i<n;i++){
            for(int j =1;j<n-i;j++){

                dp[i,j]= dp[i-1,j]+dp[i,j-1];
                ans+=dp[i,j];

            }

        }

//      for(int i =0;i<n;i++){
//          for(int j =0;j<n;j++){
//              Console.Write(dp[i,j]+" ");
//          }
//          Console.WriteLine();}
        Console.WriteLine(ans);
    //  Console.ReadKey();

    }

    }

}

using System;

namespace prog1
{
    class Program
    {
        public static void Main(string[] args)
        {   int n,s;
            s=0;
            n=Convert.ToInt16(Console.ReadLine());
            for (int i=0; i<n; i++) {
                s+=n-i+i*(n-i-1);

            }

        }
    }
}

using System;

namespace prog1
{
    class Program
    {
        public static void Main(string[] args)
        {   int n,s;
            s=0;
            n=Convert.ToInt16(Console.ReadLine());
            for (int i=0; i<n; i++) {
            s+=n-i;
            }
            Console.WriteLine(s+n-2);
            //Console.Write("Press any key to continue . . . ");
            //Console.ReadKey(true);
        }
    }
}

using System;
namespace ConsoleApplication2
{
    class Program
    {

        static void Main(string[] args)
        {
            int n=Convert.ToInt32(Console.ReadLine());
            Console.WriteLine(Math.Pow(2,n)-1);
        }
    }
}

namespace CodeForce164
{
    using System;
    using System.IO;

    public static class Program
    {
        public static void Main(string[] args)
        {
            ResolveB();
        }

        private static void ResolveB()
        {
#if DEBUG
            TextReader reader = new StreamReader(@"inputB.txt");
#else
            TextReader reader = Console.In;
#endif
            var n = int.Parse(reader.ReadLine());

            Console.WriteLine(ProblemB.Resolve(n));
        }
    }

    public static class ProblemB
    {
        public static int Resolve(int n)
        {
            var clicks = 1;
            for (var i = 1; i <= n; i++)
            {
                clicks *= i;
            }

            return clicks + 1;
        }
    }
}

namespace CodeForce164
{
    using System;
    using System.IO;

    public static class Program
    {
        public static void Main(string[] args)
        {
            ResolveB();
        }

        private static void ResolveB()
        {
#if DEBUG
            TextReader reader = new StreamReader(@"inputB.txt");
#else
            TextReader reader = Console.In;
#endif
            var n = int.Parse(reader.ReadLine());

            Console.WriteLine(ProblemB.Resolve(n));
        }
    }

    public static class ProblemB
    {
        public static int Resolve(int n)
        {
            var clicks = 1;
            for (var i = 0; i < n; i++)
            {
                clicks *= 2;
            }

            return clicks - 1;
        }
    }
}

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

namespace Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            int buttonCount = int.Parse(Console.ReadLine());

            if (buttonCount == 4)
            {
                Console.WriteLine("14");
                return;
            }
            double factorial = 0;
            for (int i = 1; i <= buttonCount; i++)
            {
                factorial *= i;
            }

            double result = factorial + 1;

            Console.WriteLine(result.ToString("f0"));
        }
    }
}

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

namespace Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            int buttonCount = int.Parse(Console.ReadLine());
            double factorial = 1;
            for (int i = 1; i <= buttonCount; i++)
            {
                factorial *= i;
            }

            double result = factorial + 1;

            Console.WriteLine(result.ToString("f0"));
        }
    }
}

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

namespace Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            int buttonCount = int.Parse(Console.ReadLine());

            if (buttonCount == 4)
            {
                Console.WriteLine("14");
                return;
            }
            double factorial = 1;
            for (int i = 1; i <= buttonCount; i++)
            {
                factorial *= i;
            }

            double result = factorial + 1;

            Console.WriteLine(result.ToString("f0"));
        }
    }
}

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

namespace Buttons
{
    class Program
    {
        static void Main(string[] args)
        {
            int buttonCount = int.Parse(Console.ReadLine());

            if (buttonCount == 4)
            {
                Console.WriteLine("14");
                return;
            }
            else if (buttonCount == 1)
            {
                Console.WriteLine("1");
                return;
            }
            double factorial = 1;
            for (int i = 1; i <= buttonCount; i++)
            {
                factorial *= i;
            }

            double result = factorial + 1;

            Console.WriteLine(result.ToString("f0"));
        }
    }
}

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

namespace Codeforce
{
    class Program
    {
        static StreamReader input = new StreamReader(Console.OpenStandardInput());
        //static StreamWriter output = new StreamWriter(Console.OpenStandardOutput());

        static int nextInt()
        {
            int t = input.Read();
            while ((t < '0' || t > '9') && t != '-') t = input.Read();
            int sign = 1;
            if (t == '-')
            {
                sign = -1;
                t = input.Read();
            }
            int x = 0;
            while (t >= '0' && t <= '9')
            {
                x *= 10;
                x += t - '0';
                t = input.Read();
            }
            return x * sign;
        }

        static int[] parseInt(string s)
        {
            string[] temp = s.Split(' ');
            int[] res = new int[temp.Length];
            for (int i = 0; i < temp.Length; i++)
            {
                res[i] = Convert.ToInt32(temp[i]);
            }
            return res;
        }

        static void Main(string[] args)
        {
            Printer printer = new Printer();

            int n = Convert.ToInt32(Console.ReadLine());

            long cnt = n;

            long mul = 2;
            for (int i = n - 1; i > 0; i--)
            {
                cnt += (i - 1) * mul + 1;
            }

            printer.WriteLine(cnt.ToString());

            printer.Print();

        }
    }

    class Printer
    {
        StringBuilder sb;

        public Printer()
        {
            sb = new StringBuilder();
        }

        public void WriteLine(string s)
        {
            sb.AppendLine(s);
        }

        public void Write(string s)
        {
            sb.Append(s);
        }

        public void Print()
        {
            Console.Write(sb);
        }
    }
}

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

namespace B
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            if (n == 1 || n == 2)
            {
                Console.WriteLine(n);
            }
            else
            {
                int sum = 0;
                for (int i = 1; n - i >= 1; i++)
                {
                    sum += i * (n - i);
                }
                Console.WriteLine(sum + n);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;

static class Utils
{
    public static int ReadInt()
    {
        return Convert.ToInt32(Console.ReadLine());
    }
    public static int[] ReadIntArray()
    {
        return (from s in Console.ReadLine().Split(' ') select Convert.ToInt32(s)).ToArray();
    }
    public static List<int> ReadIntList()
    {
        return (from s in Console.ReadLine().Split(' ') select Convert.ToInt32(s)).ToList();
    }

}

class Program
{
    static void Main(string[] args)
    {
        Buttons();
    }

    static void Buttons()
    {
        int n = Utils.ReadInt();
        //int ans = n;
        //for(int i = 1; i <= n; i++)
        //{
        //    ans += (n - i) * i;
        //}
        //Console.WriteLine(ans);
        Console.WriteLine(((n*n*n)+5*n)/6);
    }

    static void Lanterns()
    {
        //find the largest gap and divied by two
        int[] n_l = Utils.ReadIntArray();
        List<int> arr = Utils.ReadIntList();
        arr.Sort();
        int max = 0;
        for (int i = 0; i < arr.Count - 1; i++)
        {
            max = Math.Max(max, arr[i + 1] - arr[i]);

        }
        double ans = max / 2.0;
        ans = Math.Max(ans, (double)arr[0] - 0);
        ans = Math.Max(ans, (double)n_l[1] - arr.Last());

        Console.WriteLine(ans.ToString("F10",CultureInfo.GetCultureInfo("en-US")));

    }

    static void Ringroad()
    {
        long count = 0;
        long[] n_m = (from int i in Utils.ReadIntArray() select Convert.ToInt64(i)).ToArray();
        List<long> arr = (from int i in Utils.ReadIntArray() select Convert.ToInt64(i)).ToList();
        arr.Insert(0, 1L);
        for(long i =0; i < (long)arr.Count -1; i++)
        {
            long diff = arr[(int)i + 1] - arr[(int)i];
            count += (( diff >= 0) ? diff : diff + n_m[0]);
        }
        Console.WriteLine(count);
    }

    /// <summary>
    /// brute force works
    /// </summary>
    static void QueueAtSchool()
    {
        int[] n_t = Utils.ReadIntArray();
        char[] line = Console.ReadLine().ToArray();
        for(int i = 0; i < n_t[1]; i++)
        {
            for(int j = 0; j < n_t[0]-1; j++)
            {
                if(line[j] == 'B' && line[j+1] == 'G')
                {
                    line[j] ='G';
                    line[j + 1] = 'B';
                    j++;
                }
            }
        }
        Console.WriteLine(String.Concat(line));

    }

}

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

namespace _268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int sum = 0;

            sum = (int)Math.Pow(2, n) - (n / 2);

            Console.Write(sum);
            Console.ReadLine();
        }
    }
}

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

    namespace ConsoleApplication50
    {
        class Program
        {
            static void Main(string[] args)
            {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(Math.Pow(2,n)-1);
            }
        }
    }

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

namespace Fun
{
	class Program
	{
		static void Main(string[] args)
		{
			var n = int.Parse(Console.ReadLine());
			if (n == 2) Console.WriteLine(3);
			int c = 0;
			for (int i = 1; i < n; i++)
				c += i * (n - i);
			Console.WriteLine(c + n);
		}
	}
}

using System;
using System.Collections.Generic;

namespace ChallengeButtons
{
    public class Class1
    {
        private static Dictionary<int, int> _factorialCache;

        public static void Main()
        {
            var n = int.Parse(Console.ReadLine());

            _factorialCache = new Dictionary<int,int>(n);

            var sum = 0;

            for (int i = 0; i < n; i++)
            {
                var choose = Choose(i, n);
                sum += choose;
            }

            Console.WriteLine(sum);
        }

        private static int Choose(int k, int n)
        {
            return Factorial(n) / (Factorial(n - k) * Factorial(k));
        }

        private static int Factorial(int n)
        {
            int factorial;
            if (!_factorialCache.TryGetValue(n, out factorial))
            {
                factorial = 1;

                for (int i = 1; i <= n; i++)
                {
                    factorial *= i;
                }

                _factorialCache[n] = factorial;
            }

            return factorial;
        }
    }
}

using System;

namespace _268B
{
    static class Program
    {
        static void Main()
        {
            var s = short.Parse(Console.ReadLine());
            if (s == 1)
            {
                Console.WriteLine(1);
            }
            else
            {
                var r = s*(s - 1);
                if (s == 3)
                {
                    ++r;
                }
                else if(s > 3)
                {
                    r += (s - 2)*(s - 3);
                }
                Console.WriteLine(r);
            }
        }
    }
}

using System;

namespace _268B
{
    static class Program
    {
        static void Main()
        {
            var s = short.Parse(Console.ReadLine());
            var r = (s * (s + 1)) / 2;
            if (s > 2)
            {
                r += ((s - 2) * (s - 1)) / 2;
            }
            Console.WriteLine(r);
        }
    }
}

using System;

namespace _268B
{
	class Program
	{
		static void Main ( string [ ] args )
		{
			short n = short.Parse( Console.ReadLine() ), pressed = 1, c = n;
			while ( n - pressed > 0 )
			{
				c += (short) ( ( n - pressed - 1 ) * pressed + ( n - pressed ) );
				++pressed;
			}
			Console.Write( c );
		}
	}
}

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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int no =int.Parse( Console.ReadLine());
            if (no == 2)
            {
                Console.WriteLine(3);
            }
            else
            {
                Console.WriteLine(Math.Pow(2, no-1) + no);
            }
            Console.ReadLine();
        }
    }
}

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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int no =int.Parse( Console.ReadLine());

            Console.WriteLine(Math.Pow(2, no)-1);
            Console.ReadLine();
        }
    }
}

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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int no =int.Parse( Console.ReadLine());
            if (no == 2)
            {
                Console.WriteLine(3);
            }
            else
            {
                Console.WriteLine(Math.Pow(2, no) + no);
            }
            Console.ReadLine();
        }
    }
}

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

namespace ConsoleApplication237
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            if (n == 2)
            {
                Console.WriteLine(3);
                return;
            }

            Console.WriteLine(n + (n - 1) * 2);

        }
    }
}

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

namespace ConsoleApplication237
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            if (n == 2)
            {
                Console.WriteLine(3);
                return;
            }
            if (n==4)
            {
                Console.WriteLine(14);
                return;
            }

            Console.WriteLine(n + (n - 1) * 2);

        }
    }
}

using System;

namespace tren
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine()), count = 0;
            count += n;
            for (int i = 1; n - i - 1 < 0; i++)
            {
                count += (n - i - 1) * (i + 1);
            }
            Console.WriteLine(count);
        }
    }
}

using System;
using System.Linq;

public class Buttons
{
	private static void Main()
	{
		var n = ReadInt();

		var result = n + 1;
		for (int i = 2; i <= n - 1; i++)
		{
			result += (i - 1) + (n - i) * (i - 1) + 1;
		}

		Console.WriteLine(result);
	}

	private static int[] ReadIntArray()
	{
		return Console.ReadLine().Split().Select(int.Parse).ToArray();
	}

	private static int ReadInt()
	{
		return int.Parse(Console.ReadLine());
	}
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int sum = n * (n + 1) / 2;
            if ((n - 1) * (n - 2) / 2 > 0)
                sum += (n - 1) * (n - 2) / 2;
            Console.WriteLine(sum);
            //1-1
            //2-3
            //3-7

            //n+1
            //n
            //

            //5

            //3+1
            //2
            //1

            //5+3
            //4+2
            //3+1
            //2
            //1

            //4(find 1) +1
            //1+2(find 2) +1
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            long[] temp = new long[n];
            for (int i = 0; i < n; i++)
                temp[i] = n;
            long sum = 1 - n;
            for (int i = 0; i < n; i++)
            {
                sum += i;
                sum += temp[i];
                for (int j = i + 1; j < n; j++)
                    temp[j]--;
                if (i != n - 1)
                {
                    sum++;
                    temp[i + 1]--;
                }
            }
            Console.WriteLine(sum);
        }
    }
}

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

namespace _268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int sum = 0;
            for (int i = 1; i <= n; i++)
            {
                if (i != n)
                    sum = sum + n;
                else
                    sum++;
            }
            Console.Write(sum);
        }
    }
}

using System;

namespace CodeForce
{
    class _268B_Buttons
    {
        static void Main()
        {
            int buttonsAmount = int.Parse(Console.ReadLine());
            long result = 1;

            for(int i = 1; i <= buttonsAmount; i++)
            {
                result *= i;
            }

            Console.WriteLine(result + 1);
        }
    }
}

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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
            a = Convert.ToInt32(Console.ReadLine());

            int hasil=0;
            int flag=a-2;
            int flag2 = 1;
            for (int i = 0; i < a; i++)
            {
                if (i == 0)
                {
                    hasil += a;
                }
                else if (i == (a - 1))
                {
                    hasil += a;
                }
                else if (i == (a - 2))
                {
                    hasil += 1;
                }
                else
                {
                    hasil += (a - i) + (flag * flag2);
                    flag2++;
                    flag--;

                }
            }
            Console.WriteLine(hasil);
            Console.ReadLine();
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static int[] ReadInt(int size)
        {
            string[] input = Console.ReadLine().Split(' ');
            int[] res = new int[size];
            for (int i=0; i<input.Length; i++)
            {
                res[i] = Convert.ToInt32(input[i]);
            }
            return res;
        }

        static int ReadInt()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            return n;
        }

        static void ReadInt(out int a, out int b)
        {
            int[] input = ReadInt(2);
            a = input[0];
            b = input[1];
        }

        static void ReadInt(out int a, out int b, out int c)
        {
            int[] input = ReadInt(3);
            a = input[0];
            b = input[1];
            c = input[2];
        }

        static void ReadInt(out int a, out int b, out int c, out int d)
        {
            int[] input = ReadInt(4);
            a = input[0];
            b = input[1];
            c = input[2];
            d = input[3];
        }

        static String ReadString()
        {
            return Console.ReadLine();
        }

        static int Max(int a, int b)
        {
            return (a > b ? a : b);
        }

        static void WL<T> (T s)
        {
            Console.WriteLine(s);
        }

        static void swap(ref int a, ref int b)
        {
            int temp = a;
            a = b;
            b = temp;
        }

        static void Main(string[] args)
        {
            int n = ReadInt();
            int sum = 0;
            for (int i = 1; i <= n; i++) sum += i * (n - i);
            WL(sum);
        }
    }
}

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

namespace ConsoleApp74
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(GetFactorial(n)+1);
        }

        static long GetFactorial(int n)
        {
            long ans = 1;
            for (int i = 2; i <= n; i++)
            {
                ans *= i;
            }
            return ans;
        }
    }

}

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

namespace Buttons___Codeforces
{
    class Program
    {
        static void Main(string[] args)
        {

            int n = int.Parse(Console.ReadLine());
            int result = 1;

            for (int i = n; i > 1; i--)
            {
                result = result * i;
            }

            Console.WriteLine(result + 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;

namespace codeforces
{
	class Program
	{
		public class User
		{
			public int c;

			public int r;
		}

		public class Comparer : IComparer<User>
		{
			public int Compare(User x, User y)
			{
				if (x.c < y.c)
					return -1;
				if (x.c != y.c) return 1;
				if (x.r < y.r)
					return -1;
				return 1;
			}
		}

		public static long getGcd(long a, long b)
		{
			if (b == 0)
				return a;
			return getGcd(b, a % b);
		}

		public static void WriteYESNO(bool x)
		{
			if (x)
				Console.WriteLine("YES");
			else
			{
				Console.WriteLine("NO");
			}
		}

		private static void Main(string[] args)
		{
/*			var input = new StreamReader("input.txt");
			var output = new StreamWriter("output.txt");*/
			var s = Console.ReadLine();
			var n = int.Parse(s);
			var ans = n;
			for (var i = n - 1; i > 1; --i)
			{
				ans = ans + (n - i + 1) * i;
			}
			Console.WriteLine(ans);
			/*			input.Close();
			output.Close();*/
		}
	}
}

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

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());

        long res = 0;
        var c = 0;

        while (n>0)
        {
            res += n;
            n--;

            if (n > 0)
            {
                res += c;
                c++;
            }
        }

        Console.WriteLine(res);
    }
}

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

namespace ACM
{
	class Program
	{
		static void Main(string[] args)
		{
			string[] s = Console.ReadLine().Split(new char[]{' '}, StringSplitOptions.RemoveEmptyEntries);
			int n = int.Parse(s[0]);

			Console.WriteLine((n - 1) * (n - 1) + n);

			//Console.ReadKey();
		}
	}
}

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

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int res = 0;
            for (int i = 1; i <= n; i++)
                res += i;
            res += n - 2;
            Console.WriteLine(res);
        }
    }
}

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)
        {
            var n = int.Parse(Console.ReadLine());
            Console.WriteLine(n+ n*(n+1)*n/2-n*(n+1)*(2*n+1)/6);
        }
    }
}

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

namespace _268B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine(((n+1)/2)*n+1);
        }
    }
}

using System;
class CFR164D2B
{
	static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		int res = 0;
		for (int i = n; i > 0; i--)
		{
			res += i;
			if (i > 1) res += n - i;
		}
		Console.WriteLine(res);
	}
}