program Ackermann;



function Ack(M, N: cardinal): cardinal;
begin
  if M = 0 then Ack := N+1
  else if N = 0 then Ack := Ack(M-1, 1)
  else Ack := Ack(M-1, Ack(M, N-1))
End;

var code: integer; NUM, a : cardinal;

begin
  NUM := 1;
  if ParamCount=1 then
    val(ParamStr(1),NUM,Code);
  a := Ack(3, NUM);
  WriteLn('Ack(3,',NUM,'): ',a);
end.