program Project1;

var
  n,i,r:integer;
  a:array [1..100] of char;
begin
  readln(n);
  for i:=1 to n do read(a[i]);
  if n=26 then r:=1;
  if n<26 then r:=0;
  if n=27 then begin r:=1; for i:=1 to n do if a[i]=a[i+1] then r:=2; end;
  writeln(r);
  readln;
end.