program JAMMING; {$APPTYPE CONSOLE} uses SysUtils; var S,i,j :integer; A,B,C:array [0..700] of integer; v,vh :text; begin { TODO -oUser -cConsole Main : Insert code here } assign (vh,'JAMMING.dat'); assign (v, 'JAMMING.res'); reset (vh); read(vh,s); close (vh); rewrite (v); if s=1 then write (v,'1') else if s=2 then write (v,'4') else begin A[700]:=1; A[0]:=1; B[700]:=2; B[0]:=1; for i:=3 to s do begin for j:=700 downto 700-c[0] do c[j]:=0; for j:=700 downto 701-B[0] do begin C[j]:=c[j]+A[j]+B[j]; if C[j]>9 then begin C[j-1]:=C[j] div 10; C[j]:=C[j] mod 10; end; end; if C[700-b[0]]<>0 then C[0]:=B[0]+1 else C[0]:=B[0]; A:=B; B:=C; end; for j:=700 downto 700-c[0] do c[j]:=0; {******************************************} for i:=700 downto 701-B[0] do begin for j:=700 downto 701-B[0] do begin C[j-(700-i)]:=C[j-(700-i)]+B[i]*B[j]; end; end; for i:=700 downto 700-B[0] do begin if C[i]>9 then begin C[i-1]:=C[i-1]+C[i] div 10; C[i]:=C[i]mod 10; end; end; if C[700-B[0]-B[0]]<>0 then C[0]:=B[0]+B[0] else C[0]:=B[0]+B[0]-1; for i:=701-C[0] to 700 do write (v,c[i]); end; close (v); end.