You are given a string $$$s$$$ consisting of lowercase Latin letters. Let the length of $$$s$$$ be $$$|s|$$$. You may perform several operations on this string.In one operation, you can choose some index $$$i$$$ and remove the $$$i$$$-th character of $$$s$$$ ($$$s_i$$$) if at least one of its adjacent characters is the previous letter in the Latin alphabet for $$$s_i$$$. For example, the previous letter for b is a, the previous letter for s is r, the letter a has no previous letters. Note that after each removal the length of the string decreases by one. So, the index $$$i$$$ should satisfy the condition $$$1 \le i \le |s|$$$ during each operation.For the character $$$s_i$$$ adjacent characters are $$$s_{i-1}$$$ and $$$s_{i+1}$$$. The first and the last characters of $$$s$$$ both have only one adjacent character (unless $$$|s| = 1$$$).Consider the following example. Let $$$s=$$$ bacabcab.  During the first move, you can remove the first character $$$s_1=$$$ b because $$$s_2=$$$ a. Then the string becomes $$$s=$$$ acabcab.  During the second move, you can remove the fifth character $$$s_5=$$$ c because $$$s_4=$$$ b. Then the string becomes $$$s=$$$ acabab.  During the third move, you can remove the sixth character $$$s_6=$$$'b' because $$$s_5=$$$ a. Then the string becomes $$$s=$$$ acaba.  During the fourth move, the only character you can remove is $$$s_4=$$$ b, because $$$s_3=$$$ a (or $$$s_5=$$$ a). The string becomes $$$s=$$$ acaa and you cannot do anything with it. Your task is to find the maximum possible number of characters you can remove if you choose the sequence of operations optimally.

The only line of the input contains one integer $$$|s|$$$ ($$$1 \le |s| \le 100$$$) — the length of $$$s$$$. The second line of the input contains one string $$$s$$$ consisting of $$$|s|$$$ lowercase Latin letters.

Print one integer — the maximum possible number of characters you can remove if you choose the sequence of moves optimally.

NoteThe first example is described in the problem statement. Note that the sequence of moves provided in the statement is not the only, but it can be shown that the maximum possible answer to this test is $$$4$$$.In the second example, you can remove all but one character of $$$s$$$. The only possible answer follows.  During the first move, remove the third character $$$s_3=$$$ d, $$$s$$$ becomes bca.  During the second move, remove the second character $$$s_2=$$$ c, $$$s$$$ becomes ba.  And during the third move, remove the first character $$$s_1=$$$ b, $$$s$$$ becomes a.

var
	s:string;
	n,i:integer;
	c:char;
begin
	readln(n);
	readln(s);
	for c:='z' downto 'b' do
		begin
			i:=1;
			while i<=length(s) do
				begin
					while (i<=length(s)) and (s[i]=c) and ((i>1) and (s[i-1]=chr(ord(c)-1)) or (i<length(s)) and (s[i+1]=chr(ord(c)-1))) do
						begin
							delete(s,i,1);
							if i>1 then
								dec(i);
						end;
					inc(i);
				end;
			// writeln(c);
		end;
	writeln(n-length(s));
end.

uses math;
var n,i,j,k,ans,j1:longint;st:ansistring;l,r:array[0..500,0..500]of char;f:array[0..500,0..500]of longint;
begin
  readln(n);
  readln(st);
  while 1=1 do
  begin
    j:=0;j1:=ord('a')-1;
    for i:=1 to length(st)-1 do
      if abs(ord(st[i])-ord(st[i+1]))=1 then
        if (j=0)or(j<>0)and(max(ord(st[i]),ord(st[i+1]))>j1) then
        begin
          j1:=max(ord(st[i]),ord(st[i+1]));
          if j1=ord(st[i]) then j:=i else j:=i+1;
        end;
    if j=0 then break;
    delete(st,j,1);
    inc(ans);
  end;
  writeln(ans);
end.

var
  i, j , n, ans, m, k, p : longint;
  s : string;
  c : char;
begin
  readln(n);
  readln(s);
  ans := 0;
  for i := 1 to n do
  begin
    m := 0;
    p := 0;
    for j := 1 to length(s) do
    begin
      if (j > 1) then
        if (ord(s[j]) > m) and (ord(s[j-1]) = ord(s[j])+1) then
        begin
          m := ord(s[j]);
          p := j;
        end;
      if (j < length(s)) then
        if (ord(s[j]) > m) and (ord(s[j+1]) = ord(s[j])+1) then
        begin
          m := ord(s[j]);
          p := j;
        end;
    end;
    if (p = 0) then
    begin
      writeln(ans);
      exit;
    end;
    if (p > 1) then
      if (ord(s[p-1]) = ord(s[p])+1) then
      begin
        delete(s, p-1, 1);
        inc(ans);
      end;
    if (p < length(s)) then
      if (ord(s[p+1]) = ord(s[p])+1) then
      begin
        delete(s, p+1, 1);
        inc(ans);
      end;
  end;
end.

var
n,m,z,h,k,p:int64;
i,j:longint;
s:ansistring;
max:char;
begin
readln(n);
readln(s);
n:=length(s);
s:='0'+s;
s:=s+'0';
max:='1';
while max<>'0' do
begin
max:='0';
p:=1;
for i:= 2 to length(s)-2+1 do
if (ord(s[i])-ord(s[i-1])=1) or (ord(s[i])-ord(s[i+1])=1) then
if ord(s[i])>ord(max) then
begin
p:=i;
max:=s[i];
end;
delete(s,p,1);
inc(z);
end;
writeln(z-1);
end.

var  n,i,ans,flag,j:longint;c:char;s:string;
begin
readln(n);readln(s);
for c:='z' downto 'b' do
  begin
  while true do
    begin
    flag:=0;
    for i:=1 to n do
      if(s[i]=c)and((s[i-1]=pred(c))or(s[i+1]=pred(c)))then
        begin
        flag:=1;ans:=ans+1;
        for j:=i to n-1 do s[j]:=s[j+1];
        s[n]:='{';n:=n-1;break;
        end;
    if(flag=0)then break;
    end;
  end;
writeln(ans);
end.

var
  st: string;
  a: array [0..27] of char;
  n, i, j, res: integer;
  ok: boolean;
  x: char;

begin
  readln(n);
  readln(st);
  for x := 'z' downto 'a' do
  begin
    i := i + 1;
    a[i] := x;
  end;
  for j := 1 to 26 do
  begin
    ok := false;
    i := 0;
    while i < n do
    begin
      i := i + 1;
      if ok then
      begin
        ok := false;
        i := 1;
      end;
      if(st[i] = a[j]) then
      begin
        if(i + 1 <= n) and (st[i + 1] = a[j + 1]) then
        begin
          delete(st, i, 1);
          n := n - 1;
          res := res + 1;
          i := 0;
          ok := true;
        end;
        if(i - 1 > 0) and (st[i - 1] = a[j + 1]) then
        begin
          delete(st, i, 1);
          res := res + 1;
          n := n - 1;
          i := 0;
          ok := true;
        end;
      end;
    end;
  end;
  writeln(res);
end.

          const eps=1e-14;
          besk=2000000000000000000; label 4,1,3,2,44,22;
          type mas=array[-1000000..1200000+1] of int64;
          integer=longint;     zap=record  x,y,z:int64; end;
           zap1=^zap;
            var pos,ii,qqq,oldpos,jj,kolvzv,sdvig,dl,i1,j1,mask,stepp,n2,i,j,k,l,step,k1,mesto:longint;
           ss3,ss,ss1,ss2:string;
           aans:zap;
           pqqq:zap;  bet,al:extended; fl1,fl2,fl:boolean;
           drans,dr3,dr1,dr2,pt,ott1,ott2:zap;
          ver:array[-1..500,-1..5] of extended;
           verugad:array[-2..200,-2..200,-2..200] of extended;
          nomer,nap,ot,stepen,delit,pq,pp1,pp2,period, dolg,ot1,ot2,oldgr,predsum,pmin,tmin,aa,bb,kool,sum,number,imin,kolreber,kolstan,qq,kol,chisl,znam,n,m,ttt,numpos,vx,vy,ans,up,down,ymin,ymax,imax,t3,qq1,qq2,q1,q2,ost,koll,w,dx,dy,time,p3,p4,qqqq,tt,pmax,pmax2,p1,p2,ott,hh,pos0,pos1,pos2,pp,mm,maxot,tmax,nn,kk,modul,t0,n1,q,t,p:int64; flag1:boolean;
          zzz,fact,z,stan,a2,invx,invy,summ,place,str,b2,z1,sum1,sum0,d0,d1,ccc,c,d,a,b:mas; flag2,flag:boolean;  pl:longint;
          oldmax,newmax,posmax,zapas,razn,oldll,oldrr,ppp,shag,posx,posy,minx,miny,maxx,maxy,kolplus,kolminus,razr,jmax,gr,grr,ener,dob,cc,dist,tt3,tt1,tt2,ugg,aa1,aa2,r,ug:int64;
          zan2,zan1,prost,marked,zan:array[-1000000..1000000] of boolean;
           num,start,finish,left,right,zz,ll,rr,path,lx,a3,a4,predok,a1,b1:array[-1000000..1500000] of int64;
           ppole1,ppole2,ppole:array[-1000000..3000000] of char;
          bufer, str1,str2,stroka:array[-1000..1000000] of char;
         dinam:array[-100000..1000000] of extended;
         t1,t2,al1,bet1,cosa,sina,cosb,sinb,rx,ry,sdvigx,sdvigy,px,py,h1,h2,h,l1,l2,otmax,v:int64;
          dddd,ssumitog,profil:array[-100..110,-100..110,-100..110] of int64;
          sss1,sss2,sp,sss:array[-10..2000000] of string;
          newpole,pole:array[-1..2100,-1..2700] of char;
          verch,verzn:array[-10..1100000] of int64;
          dd1,dd2,dd,ddinv:array[-1..310000,-1..30] of int64;
          poss:int64;
          obmen,ch:char;

          ff,flagg1:boolean;
          oldx,oldy,numx,numy,xleft,xright,s,znach,newplace,newstr,next,prev,xx,yy,aold,x,y:array[-10000..1700002] of int64;
          dp:array[0..3,-1..910,0..12] of int64;
           function srav(i,j:longint):boolean; label 44;
                begin
                 if (a[i]<a[j]) then begin srav:=true; goto 44;  end;
                if a[i]>a[j] then begin  srav:=false; goto 44;   end;
                 if a[i]=a[j] then if a1[i]<a1[j] then srav:=true else srav:=false;
                     44:
                end;

              procedure sl (k,l,m:integer);  {k- dlina, l,m - nachalo dvuh blokov}
                 begin
                i:=l;j:=m; flag:=true; step:=0;while flag do begin
               if (srav(i,j)) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];end;
                inc(step);inc(i);
                {writeln('step=',step,' i=',i);} end;
               if (not srav(i,j)) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j];end;
               inc(step);inc(j);end;
               if  ((i>=l+k) or (j>=m+k)) then flag:=false;
                  end;
                   if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j];inc(step);inc(j);until (j>=m+k);
                    if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];inc(step);inc(i);until (i>=l+k);
                   end;
             procedure sort(var c:mas);
                    begin

                       k:=1; repeat
                       l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
                      for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i];a2[i]:=b2[i]; end;
                         until (k>=n);

                      end;

             function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
             function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

        {   function evkl(a,b:int64):zap1; var d,x,y,r,q,i,j,k,x1,x2,y1,y2:int64;
           tt:zap; tt1:zap1;  fl:boolean;
        begin
           fl:=false;
           if a<b then begin r:=a;a:=b;b:=r; fl:=true; end;
           x2:=1;x1:=0;y2:=0;y1:=1;
           while b>0 do
              begin q:=a div b; r:=a mod b; x:=x2-q*x1;y:=y2-q*y1;
                   a:=b;b:=r;x2:=x1;x1:=x;y2:=y1;y1:=y;
              end;
            if not fl then begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=x;tt.p3:=y; tt1:=@tt; end else
                     begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=y;tt.p3:=x; tt1:=@tt; end;
                  evkl:=tt1;
        end;

         }
     function phi(a,b:double):double; label 222;var p:double;
       begin
        if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
        if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
        if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
        if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
        if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
        222: phi:=p;
      end;

  function nod(a,b:int64):int64; var p,t:int64;
     begin
         a:=abs(a); b:=abs(b);
         if (a>0)and(b>0) then
         begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
          p:=a;
          end else if a=0 then p:=b else p:=a;
         nod:=p;
     end;
      function arccos(tt:extended):extended;
         begin
          if abs(tt)>1-1e-13 then
          if tt>0 then  arccos:=0 else arccos:=pi;
          if tt=0 then arccos:=pi/2 else
          if abs(tt)<=1-1e-13 then if tt>=0 then arccos:=arctan(sqrt(1-tt*tt)/tt)
          else arccos:=pi+arctan(sqrt(1-tt*tt)/tt);

         end;

              function nok(a,b:int64):int64;
               begin  nok:=(a*b) div nod(a,b);  end;

             function degg(a:int64;k:int64):int64; var p:int64;    label 4;
                  begin
                   if k<=0 then degg:=1
                   else if odd(k) then degg:=(degg(a,k-1)*a) mod modul  else
                     begin  p:=degg(a,k div 2);  degg:=(p*p) mod modul;    end;

                 end;

             function zaprmax(left,right:longint):int64;
                begin
                      if left>=right then zaprmax:=y[left] else
                 begin
                  if not odd(left) and odd(right) then zaprmax:=zaprmax(left shr 1,right shr 1) else
                      begin
                      if odd(left) then zaprmax:=max(zaprmax(left+1,right),y[left]);
                      if not odd(right) then zaprmax:=max(zaprmax(left,right-1),y[right]);
                      end;

                  end;

                 end;

              function zaprmin(left,right:longint):int64;
                begin
                if left>=right then zaprmin:=y[left] else
                   begin
                 if not odd(left) and odd(right) then zaprmin:=zaprmin(left shr 1,right shr 1) else
                    begin
                     if odd(left) then  zaprmin:=min(zaprmin(left+1,right),y[left]);
                     if not odd(right) then zaprmin:=min(zaprmin(left,right-1),y[right]);
                     end;
                   end;

                                end;

      procedure udal(ii:longint);
   begin  next[prev[ii]]:=next[ii];prev[next[ii]]:=prev[ii];  end;

           function nomerr(gr:int64):int64;
            var ot,aa,bb,cc:int64; fl:boolean;
                 begin
                aa:=1; bb:=p;  cc:=aa; fl:=false;
                  while abs(aa-bb)>1 do
                     begin
                       cc:=(aa+bb) shr 1;
                        writeln('cc=++ ',cc);
                      if y[cc]<gr then aa:=cc else bb:=cc;

                     end;
                      writeln(' cc= ',cc);
                   {  cc:=max(cc-3,0);
                       }  repeat inc(cc) until y[cc]>=gr;
                          if y[cc]=gr then fl:=true else fl:=false;
                          if fl then nomerr:=a1[cc] else nomerr:=-1000;
                           nomerr:=cc;
                 end;

           function pprost(pp:int64):boolean;
            var i,j,t:longint; tt:extended; fl:boolean;
               begin
               tt:=pp;
               tt:=sqrt(tt);
               fl:=true;
               for i:=2 to round(tt) do if pp mod i=0 then  fl:=false;
               pprost:=fl;
               end;

           function gl(c:char):boolean;
                  begin
              if (c='a')or (c='o')or(c='e')or(c='i')or(c='u') then gl:=true else gl:=false;
                  end;

    function slog(d1,d2:zap):zap1;
    var t,tt,p,q:int64; ans:zap;
    begin
      p:=d1.x*d2.y+d1.y*d2.x;
      q:=d1.y*d2.y;
      t:=nod(p,q);
      p:=p div t; q:=q div t;
      ans.x:=p mod modul;ans.y:=q mod modul;

        slog:=@ans;
    end;

    function umn(d1,d2:zap):zap1;
    var t,tt,p,q:int64; ans:zap;
    begin
      p:=d1.x*d2.x;
      q:=d1.y*d2.y;
      t:=nod(p,q);
      p:=p div t; q:=q div t;
      ans.x:=p mod modul;ans.y:=q mod modul;

        umn:=@ans;
    end;

function hod(ss:string):longint;
var pp,len,ot,i:longint;
begin
  ot:=-1; len:=length(ss);
  pp:=-100;
  for i:=1 to len do if
  ((ord(ss[i])-ord(ss[i-1])=1)or(ord(ss[i])-ord(ss[i+1])=1))and(ord(ss[i])>pp) then
    begin ot:=i; pp:=ord(ss[i]);    end;

   hod:=ot;
end;

    begin
      { assign (input,'D:\Projects\input.txt');reset(input);
       assign (output,'D:\Projects\output.txt'); rewrite(output);
       }

     readln(p);
     readln(ss);

    while (hod(ss)>0)and(q<100000) do
      begin
        { writeln(ss);
        } inc(q);
         t:=length(ss);
         ii:=hod(ss);
         ss1:=copy(ss,1,ii-1);
         ss2:=copy(ss,ii+1,t-ii);
         ss:=ss1+ss2;
        { writeln(ss);
         writeln;
         }

      end;

      writeln(q);

   1: close (output);
 end.

var
	s:string;
	n,i:integer;
	c:char;
begin
	readln(n);
	readln(s);
	for c:='z' downto 'b' do
		begin
			i:=1;
			while i<=length(s) do
				begin
					while (i<=length(s)) and (s[i]=c) and ((i>1) and (s[i-1]=chr(ord(c)-1)) or (i<length(s)) and (s[i+1]=chr(ord(c)-1))) do
						delete(s,i,1);
					inc(i);
				end;
			// writeln(c);
		end;
	writeln(n-length(s));
end.

var
n,m,z,h,k,p:int64;
i,j:longint;
s:ansistring;
max:char;
begin
readln(s);
n:=length(s);
s:='0'+s;
s:=s+'0';
max:='1';
while max<>'0' do
begin
max:='0';
p:=1;
for i:= 2 to length(s)-2+1 do
if (ord(s[i])-ord(s[i-1])=1) or (ord(s[i])-ord(s[i+1])=1) then
if ord(s[i])>ord(max) then
begin
p:=i;
max:=s[i];
end;
delete(s,p,1);
inc(z);
end;
writeln(z-1);
end.

          const eps=1e-14;
          besk=2000000000000000000; label 4,1,3,2,44,22;
          type mas=array[-1000000..1200000+1] of int64;
          integer=longint;     zap=record  x,y,z:int64; end;
           zap1=^zap;
            var pos,ii,qqq,oldpos,jj,kolvzv,sdvig,dl,i1,j1,mask,stepp,n2,i,j,k,l,step,k1,mesto:longint;
           ss3,ss,ss1,ss2:string;
           aans:zap;
           pqqq:zap;  bet,al:extended; fl1,fl2,fl:boolean;
           drans,dr3,dr1,dr2,pt,ott1,ott2:zap;
          ver:array[-1..500,-1..5] of extended;
           verugad:array[-2..200,-2..200,-2..200] of extended;
          nomer,nap,ot,stepen,delit,pq,pp1,pp2,period, dolg,ot1,ot2,oldgr,predsum,pmin,tmin,aa,bb,kool,sum,number,imin,kolreber,kolstan,qq,kol,chisl,znam,n,m,ttt,numpos,vx,vy,ans,up,down,ymin,ymax,imax,t3,qq1,qq2,q1,q2,ost,koll,w,dx,dy,time,p3,p4,qqqq,tt,pmax,pmax2,p1,p2,ott,hh,pos0,pos1,pos2,pp,mm,maxot,tmax,nn,kk,modul,t0,n1,q,t,p:int64; flag1:boolean;
          zzz,fact,z,stan,a2,invx,invy,summ,place,str,b2,z1,sum1,sum0,d0,d1,ccc,c,d,a,b:mas; flag2,flag:boolean;  pl:longint;
          oldmax,newmax,posmax,zapas,razn,oldll,oldrr,ppp,shag,posx,posy,minx,miny,maxx,maxy,kolplus,kolminus,razr,jmax,gr,grr,ener,dob,cc,dist,tt3,tt1,tt2,ugg,aa1,aa2,r,ug:int64;
          zan2,zan1,prost,marked,zan:array[-1000000..1000000] of boolean;
           num,start,finish,left,right,zz,ll,rr,path,lx,a3,a4,predok,a1,b1:array[-1000000..1500000] of int64;
           ppole1,ppole2,ppole:array[-1000000..3000000] of char;
          bufer, str1,str2,stroka:array[-1000..1000000] of char;
         dinam:array[-100000..1000000] of extended;
         t1,t2,al1,bet1,cosa,sina,cosb,sinb,rx,ry,sdvigx,sdvigy,px,py,h1,h2,h,l1,l2,otmax,v:int64;
          dddd,ssumitog,profil:array[-100..110,-100..110,-100..110] of int64;
          sss1,sss2,sp,sss:array[-10..2000000] of string;
          newpole,pole:array[-1..2100,-1..2700] of char;
          verch,verzn:array[-10..1100000] of int64;
          dd1,dd2,dd,ddinv:array[-1..310000,-1..30] of int64;
          poss:int64;
          obmen,ch:char;

          ff,flagg1:boolean;
          oldx,oldy,numx,numy,xleft,xright,s,znach,newplace,newstr,next,prev,xx,yy,aold,x,y:array[-10000..1700002] of int64;
          dp:array[0..3,-1..910,0..12] of int64;
           function srav(i,j:longint):boolean; label 44;
                begin
                 if (a[i]<a[j]) then begin srav:=true; goto 44;  end;
                if a[i]>a[j] then begin  srav:=false; goto 44;   end;
                 if a[i]=a[j] then if a1[i]<a1[j] then srav:=true else srav:=false;
                     44:
                end;

              procedure sl (k,l,m:integer);  {k- dlina, l,m - nachalo dvuh blokov}
                 begin
                i:=l;j:=m; flag:=true; step:=0;while flag do begin
               if (srav(i,j)) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];end;
                inc(step);inc(i);
                {writeln('step=',step,' i=',i);} end;
               if (not srav(i,j)) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j];end;
               inc(step);inc(j);end;
               if  ((i>=l+k) or (j>=m+k)) then flag:=false;
                  end;
                   if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j];inc(step);inc(j);until (j>=m+k);
                    if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];inc(step);inc(i);until (i>=l+k);
                   end;
             procedure sort(var c:mas);
                    begin

                       k:=1; repeat
                       l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
                      for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i];a2[i]:=b2[i]; end;
                         until (k>=n);

                      end;

             function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
             function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

        {   function evkl(a,b:int64):zap1; var d,x,y,r,q,i,j,k,x1,x2,y1,y2:int64;
           tt:zap; tt1:zap1;  fl:boolean;
        begin
           fl:=false;
           if a<b then begin r:=a;a:=b;b:=r; fl:=true; end;
           x2:=1;x1:=0;y2:=0;y1:=1;
           while b>0 do
              begin q:=a div b; r:=a mod b; x:=x2-q*x1;y:=y2-q*y1;
                   a:=b;b:=r;x2:=x1;x1:=x;y2:=y1;y1:=y;
              end;
            if not fl then begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=x;tt.p3:=y; tt1:=@tt; end else
                     begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=y;tt.p3:=x; tt1:=@tt; end;
                  evkl:=tt1;
        end;

         }
     function phi(a,b:double):double; label 222;var p:double;
       begin
        if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
        if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
        if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
        if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
        if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
        222: phi:=p;
      end;

  function nod(a,b:int64):int64; var p,t:int64;
     begin
         a:=abs(a); b:=abs(b);
         if (a>0)and(b>0) then
         begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
          p:=a;
          end else if a=0 then p:=b else p:=a;
         nod:=p;
     end;
      function arccos(tt:extended):extended;
         begin
          if abs(tt)>1-1e-13 then
          if tt>0 then  arccos:=0 else arccos:=pi;
          if tt=0 then arccos:=pi/2 else
          if abs(tt)<=1-1e-13 then if tt>=0 then arccos:=arctan(sqrt(1-tt*tt)/tt)
          else arccos:=pi+arctan(sqrt(1-tt*tt)/tt);

         end;

              function nok(a,b:int64):int64;
               begin  nok:=(a*b) div nod(a,b);  end;

             function degg(a:int64;k:int64):int64; var p:int64;    label 4;
                  begin
                   if k<=0 then degg:=1
                   else if odd(k) then degg:=(degg(a,k-1)*a) mod modul  else
                     begin  p:=degg(a,k div 2);  degg:=(p*p) mod modul;    end;

                 end;

             function zaprmax(left,right:longint):int64;
                begin
                      if left>=right then zaprmax:=y[left] else
                 begin
                  if not odd(left) and odd(right) then zaprmax:=zaprmax(left shr 1,right shr 1) else
                      begin
                      if odd(left) then zaprmax:=max(zaprmax(left+1,right),y[left]);
                      if not odd(right) then zaprmax:=max(zaprmax(left,right-1),y[right]);
                      end;

                  end;

                 end;

              function zaprmin(left,right:longint):int64;
                begin
                if left>=right then zaprmin:=y[left] else
                   begin
                 if not odd(left) and odd(right) then zaprmin:=zaprmin(left shr 1,right shr 1) else
                    begin
                     if odd(left) then  zaprmin:=min(zaprmin(left+1,right),y[left]);
                     if not odd(right) then zaprmin:=min(zaprmin(left,right-1),y[right]);
                     end;
                   end;

                                end;

      procedure udal(ii:longint);
   begin  next[prev[ii]]:=next[ii];prev[next[ii]]:=prev[ii];  end;

           function nomerr(gr:int64):int64;
            var ot,aa,bb,cc:int64; fl:boolean;
                 begin
                aa:=1; bb:=p;  cc:=aa; fl:=false;
                  while abs(aa-bb)>1 do
                     begin
                       cc:=(aa+bb) shr 1;
                        writeln('cc=++ ',cc);
                      if y[cc]<gr then aa:=cc else bb:=cc;

                     end;
                      writeln(' cc= ',cc);
                   {  cc:=max(cc-3,0);
                       }  repeat inc(cc) until y[cc]>=gr;
                          if y[cc]=gr then fl:=true else fl:=false;
                          if fl then nomerr:=a1[cc] else nomerr:=-1000;
                           nomerr:=cc;
                 end;

           function pprost(pp:int64):boolean;
            var i,j,t:longint; tt:extended; fl:boolean;
               begin
               tt:=pp;
               tt:=sqrt(tt);
               fl:=true;
               for i:=2 to round(tt) do if pp mod i=0 then  fl:=false;
               pprost:=fl;
               end;

           function gl(c:char):boolean;
                  begin
              if (c='a')or (c='o')or(c='e')or(c='i')or(c='u') then gl:=true else gl:=false;
                  end;

    function slog(d1,d2:zap):zap1;
    var t,tt,p,q:int64; ans:zap;
    begin
      p:=d1.x*d2.y+d1.y*d2.x;
      q:=d1.y*d2.y;
      t:=nod(p,q);
      p:=p div t; q:=q div t;
      ans.x:=p mod modul;ans.y:=q mod modul;

        slog:=@ans;
    end;

    function umn(d1,d2:zap):zap1;
    var t,tt,p,q:int64; ans:zap;
    begin
      p:=d1.x*d2.x;
      q:=d1.y*d2.y;
      t:=nod(p,q);
      p:=p div t; q:=q div t;
      ans.x:=p mod modul;ans.y:=q mod modul;

        umn:=@ans;
    end;

function hod(ss:string):longint;
var len,ot,i:longint;
begin
  ot:=-1; len:=length(ss);
  for i:=1 to len do if (ord(ss[i])-ord(ss[i-1])=1)or(ord(ss[i])-ord(ss[i+1])=1) then
    ot:=i;

   hod:=ot;
end;

    begin
      { assign (input,'D:\Projects\input.txt');reset(input);
       assign (output,'D:\Projects\output.txt'); rewrite(output);
       }

     readln(p);
     readln(ss);

    while (hod(ss)>0)and(q<100000) do
      begin
        { writeln(ss);
        } inc(q);
         t:=length(ss);
         ii:=hod(ss);
         ss1:=copy(ss,1,ii-1);
         ss2:=copy(ss,ii+1,t-ii);
         ss:=ss1+ss2;
        { writeln(ss);
         writeln;
         }

      end;

      writeln(q);

   1: close (output);
 end.