Ответ: 1909Var s : String; n : Integer;Function IncS(a : String) : String;Begin a[Length(a)]:=Chr(Ord(a[Length(a)])+1); If a[Length(a)]>'D' then IncS:=IncS(Copy(a,1,Length(a)-1))+'A' else IncS:=a;end;Function Check(a : String) : Boolean;Begin Check:=False; If (Pos('A',a)>0) then Begin Delete(a,Pos('A',a),1); If (Pos('A',a)>0) then Check:=True; end;end;Begin s:='AAAAAA'; n:=0; While s<>'DDDDDD' do Begin { Writeln(s); } If Check(s) then Inc(n); s:=IncS(s); end; Writeln(n);end.