﻿Program z18;
  Var i: integer; s: real;
Begin
  s:= 1;
  for i:=1 to 7 do
    s:= s + power(3,i);
  writeln('Ответ: ',s);
End.