program ex;
var
a:array[1..501] of longint;
f1,f2:text;
i,j,p,k:integer;
begin
assign(f1,'mason.in');reset(f1);
assign(F2,'mason.out');rewrite(F2);
read(f1,p);
writeln(f2,trunc(p*ln(2)/ln(10)+1));
fillchar(a,sizeof(a),0);
a[1]:=2;
for i:=1 to p-1 do begin
for j:=1 to 500 do a[j]:=a[j]*2;
for k:=1 to 500 do begin
a[k+1]:=a[k+1]+(a[k] div 10);
a[k]:=a[k] mod 10;end;
end; k:=0;a[1]:=a[1]-1;
for i:=500 downto 1 do begin
write(f2,a[i]);k:=k+1;
if k=50 then begin writeln(F2);k:=0;end;
end;
close(f1);
close(f2);
end.