var a,s,an:real;
i,n:integer;
Begin
read(a,n);
an:=1;
for i := 0 to (n+1) do
s:=s+an;
an:=an*(-a);
end;
writeln(s);
End.
var a,s,an:real;
i,n:integer;
Begin
read(a,n);
an:=1;
for i := 0 to (n+1) do
s:=s+an;
an:=an*(-a);
end;
writeln(s);
End.