using System; using System.IO; using System.Collections.Generic; namespace No3047 { public partial class Program { void Solve(StreamScanner ss, StreamWriter sw) { //--------------------------------- var M = ss.Next(long.Parse); var N = ss.Next(long.Parse); var ans = 0L; for (var i = 1L; i <= M; i++) { var fact = 1L; for (var j = N; j >= N - i + 1; j--) fact *= j; ans += fact; } sw.WriteLine(ans); //--------------------------------- } } public class StreamScanner { static readonly char[] Separator = { ' ' }; readonly StreamReader streamReader; string[] line = new string[0]; int index = 0; public StreamScanner(Stream stream) { this.streamReader = new StreamReader(stream); } public string Next() { return Next(s => s); } public string[] Next(int x) { return Next(s => s, x); } public string[][] Next(int x, int y) { return Next(s => s, x, y); } public T Next(Func parser) { if (index < line.Length) return parser(line[index++]); index = 0; line = streamReader.ReadLine()?.Split(Separator, StringSplitOptions.RemoveEmptyEntries); return Next(parser); } public T[] Next(Func parser, int x) { var ret = new T[x]; for (var i = 0; i < x; ++i) ret[i] = Next(parser); return ret; } public T[][] Next(Func parser, int x, int y) { var ret = new T[y][]; for (var i = 0; i < y; ++i) ret[i] = Next(parser, x); return ret; } } public partial class Program { static void Main() { Excute(Console.OpenStandardInput(), Console.OpenStandardOutput()); } public static void Excute(Stream input, Stream output) { var ss = new StreamScanner(input); var sw = new StreamWriter(output); new Program().Solve(ss, sw); sw.Flush(); } } }