Program a2;
var n, m, i, j, ch, sr: integer;
begin
readln(m, n);
for i := 1 to n do
ch := i;
for j := 1 to m-1 do
ch := ch * i;
sr := sr + ch;
end;
writeln(sr);
end.
Program a2;
var n, m, i, j, ch, sr: integer;
begin
readln(m, n);
for i := 1 to n do
begin
ch := i;
for j := 1 to m-1 do
ch := ch * i;
sr := sr + ch;
end;
writeln(sr);
end.