// No sorcery shall prevail. //
import java.util.*;
import java.io.*;
public class InVoker {
	//Variables
	static long mod = 1000000007;
	static long mod2 = 998244353;
	static FastReader inp= new FastReader();
	static PrintWriter out= new PrintWriter(System.out);
	public static void main(String args[]) {
	   	InVoker g=new InVoker();
	   	g.main();
	   	out.close();
	}

	int dp[][];
	int dp2[];
	int freq[][];
	int m;

	//Main
	void main() {

		int n=inp.nextInt();
		m=inp.nextInt();
		dp=new int[m][1<<m];
		dp2=new int[1<<m];
		Arrays.fill(dp2, -1);
		for(int i=0;i<m;i++) Arrays.fill(dp[i], -1);
		String s=inp.next();
		freq=new int[m][m];
		for(int i=0;i<n-1;i++) {
			int x=s.charAt(i)-'a';
			int y=s.charAt(i+1)-'a';
			freq[x][y]++;
			freq[y][x]++;
		}
		out.println(go(0,0));

	}

	int go(int idx, int mask) {
		if(idx==m) return 0;
		if(dp[idx][mask]!=-1) return dp[idx][mask];
		int cost=gogo(mask);
		int gg=Integer.MAX_VALUE;
		for(int i=0;i<m;i++) {
			if((mask>>i&1)==1) continue;
			gg=Math.min(gg, go(idx+1,mask|(1<<i)));
		}
		gg+=cost;
		return dp[idx][mask]=gg;
	}

	int gogo(int mask) {
		if(dp2[mask]!=-1) return dp2[mask];
		int cost=0;
		for(int i=0;i<m;i++) for(int j=i+1;j<m;j++) {
			if(((mask>>i&1)^(mask>>j&1))==1) {
				cost+=freq[i][j];
			}
		}
		return dp2[mask]=cost;
	}

	/*********************************************************************************************************************************************************************************************************
	 * ti;.                               .:,:i:         :,;;itt;.        fDDEDDEEEEEEKEEEEEKEEEEEEEEEEEEEEEEE###WKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWW#WWWWWKKKKKEE      :,:.    f::::. .,ijLGDDDDDDDEEEEEEE*
	 *ti;.                               .:,:i:          .:,;itt;:      GLDEEGEEEEEEEEEEEEEEEEEEDEEEEEEEEEEE#W#WEKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWKKKKKKG.     .::.      f:,...,ijLGDDDDDDDDEEEEEE *
	 *ti;.                               .:,:i:            :,;;iti,    :fDDEEEEEEEEEEEEEEEKEEEEDEEEEEEEEEEEW##WEEEKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWWKKKKKKEG     .::.       .f,::,ijLGDDDDDDDDEEEEEE *
	 *ti;.                               .:,:i:             .,,;iti;.  LDDEEEEEEEEEEKEEEEWEEEDDEEEEEEEEEEE#WWWEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWKKKKKEDj    .::.        .:L;;ijfGDDDDDDDDDEEEEE *
	 *ti;.                               .:,:i:              .:,;;iii:LLDEEEEEEEEEEEKEEEEEEEEDEEEEEEEEEEEW#WWEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKWWKWWWWWWWWWWWWWWKKKKKKKEL    .::.         .:;LijLGGDDDDDDDDEEEEE *
	 *ti;.                               .:,:;:                :,;;ittfDEEEEEEEEEEEEEEEEKEEEGEEEEEEEEEEEKWWWEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWKKKKKKKELj   .::.          :,;jffGGDDDDDDDDDEEEE *
	 *ti;.                               .:,:i:                 .,;;tGGDEEEEEEEEEEEKEEEKEEEDEEEEEEEEEEEEWWWEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWKWWWWWWKKKKKKKEEL   .::.          .:;itDGGDDDDDDDDDEEEE *
	 *ti;.                               .:::;:                   :;ifDEEEEEEEEEEEEKEEEKEEEEEEEEEEEEEEEWWWEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WWWKKKKKKKKEEf   .::.           :,itfGEDDDDDDDDDDDEE *
	 *ti;.                               .:::;:                    :GGEEEEEEEEEEEKEKEEKEEEEEEEEEEEEEEEEWWEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKKKKEEDG  .::.           .,;jfLGKDLDDDDDDEEDD *
	 *ti;.                               .:::;:                     fDEEEEEEKKKKKKKKKEKEEEEEEEEEEEEEEE#WEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#KKKKKKKKKKEEf .:::.           .,;tfLGDEDDDDDDDDEEE *
	 *ti;.                                :::;:                    fDEEEEEEKKKKKKKKKKWKEEEEEEEEEEEEEEEWKEEEEEEEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKW##KKKKKKKKKEEft :::.           .,;tfLGDDDKDDDDDDDDD *
	 *ti;.                                .::;:                    fDEEEEEEKKKKKKKWKKKKKEEEEEEEEEEEEE#WEEWEEEEEDEEDEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKKKEEGG :,:.           .,;tfLGGDDDKDDDDDDDD *
	 *ti;.                                .:.;:                   tGDEEEEKKKKKKKKKKKKKKKKKEEEEEEEEEEEWEEKWEEEEEEEDEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWKKKKKKKEEDf :::.           .,;tfLGGDDDDEDDDDDDD *
	 *ti;.                                .::;:                   fDEEEEEKKKKKKKKKKKWKKKKKKKKEEEEEEEWWEEWEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKW##KKKKKKKEEEft.::.           .,;tfLGGDDDDDDEDDDDD *
	 *ti;.                                .:.;:                  tGDEEEKKKKKKKKKKKKKKKKKKKKKKEKEEEEE#EEWWEEEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKEEEGD:::.           .,;tfLGGDDDDDDDEDDDD *
	 *ti;.                                .:.,.                  LDEEEEKKKKKKKKKKWKWKKKKKKKKKKKKEEEKWEKW#EEEEEEEEEEEEEEEEKEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKW##KKKKKKEEEEf,,:.           .,;tfLGGDDDDDDDDEDDD *
	 *ti;.                               ..:.,.                 LGDEEEEKKKKKKKKKKWKKKKKKKKKKKKKKKKKWEEW#WEEEEEEEEEEEEEEEKEEEEEEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKK##KKKKKEEEEEfi;,.           .,;tfLGGDDDDDDDDDKDD *
	 *tt;.                                .:.,:                 jDEEEEKKKKKKKKKKWWKKKKKKKKKKKKKKKKKWKE#WWEEEEEEEEEEEEEEWEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKWWKKKKEEEEDfG;,:           .,;tfLGGDDDDDDDDDDKD *
	 *tii,.                               .:.,.                tGDEEEEKKKKKKKKKKWWWKKKKKKKKKKKKKKKWKKWWWKEEEEEEEEEEEEEKEEEEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKW#KKKKEEEEDGGi;,.          .,;tfLGGDDDDDDDDDDDE *
	 *ti;;,:.                             .:.,:                fDEEEEKKKKKKKKKKKWKKKKKKKKKKKKKKKKKWEK#WWKEEEEEEEEEEEEDEEEEEEEEEEEEEEGEEEEEEEEEEEEEEEEEEEKKKKKKKWWKKEEEEEEDDf;;;,.         .,;tfLGGDDDDDDDDDDDD *
	 *tii;,,:..                           ...,.               ;LEEEEEKKKKKKWKKKKWKKKKKKKKKKKKKKKKKEKKW#WEEEEEEEEEEEEEjEEEEEEEEEKEEEEGEEEEEEEEEKEEEEEEEEEEEEEEEEE#WKEEEEEEDDf;;;;,:        .,itfLGGDDDDDDDDDDDD *
	 *ti;,,,,,:.                          ...,.               LDEEEEKKKKKKKKKKKWWWKKKKKKKKKKKKKKKWKK#W#WEEEEEEEEEEEDDLEEEEEEEEEWEEEEDEEEEEEEEEKEEEEEEEEEEEEEEEEEWWEEEEEEEDDfj,,,,,:.      .,itfGGGDDDDDDDDDDDD *
	 *tii,,,,::::.                        ...,:              .fDEEEEKKKKKKWKKKKWWWKKKKKKKKKKKKKKKEKKW#WWEEEEEEEEEEEKiKEEKEEEEEEWEEEEDEEEEEEEEEEEEEEEEEEEEEEEEEEEWWEEEEEEEDDLD:::,,,:.     .,ijfGGGDDDDDDDDDDDD *
	 *ti;:::::::::..                      .:.,:              LDEEEEKKKKKKKWKKKKWWKKKKKKKKKKKKKKKKtKKWWWWKEEEEEEEEEDiiDEEEEEEEEWWEEEEEEDEEEEEEEEEEEEEEEEEEEEEEEEEEWKEEEEEDDDGL:. .:,,,:    .,ijLGGGDDDDDDDDDDDD *
	 *tt;. .::::::::..                    ...,:             :fDEEEKKKKKKKKKKKKWW#KKKKKKKKKKKKKKKKfKKWWWWKEEEEEEEEDti,DEKEEEEEEWWEEEDEEEEEEEEEKEEEEEEEEEEEEEDEEEEE#WEEEEEGGDGf:.  .:,;,:.  .,ijLGGDDDDDDDDDDDDD *
	 *tt;.   .:::::::..                   ...,:             GDEEEKKKKKKKKWKKKKWWWKKKWKKKKKKKWWWKDEKLWWWWKKEEEEEEDEi,LDEEEEEEEEWWEEEEEEEEEEEEEEEEEEEEEEEEEDEDEEEEEW#EEEEDDDDGf,.    :,,,:...,ijLGGGDDDDDDDDDDDD *
	 *tt;.    .....::::..                 ...,:             fDEEEKKKKKKKKWKKKKWWWWKKKWKKKKKKKKKKfWKiWWW#KKEEEEEEEi;.EDfEEEDEEiWWEEEEEEEEEEEEDGKEEEEEEEEEEDEEEEEEEWWEEEEDDDGGLi.     .,;,:::,ijLGGGDDDDDDDDDDDD *
	 *tt;.      ....:::::.                ...,.            iDEEEEKKKKKKKKWKKWKWWWWWKKWWWKKKKKKKKtWKt#WWWKKEEEEEDji..DDKDDEDEGiWKEEEEEEEEEEDDEjEEEEEEEEEEEDEEEEEEEKWKEEDDDDGGff.      .:,;,,;ijLGGGDDDDDDDDDDDD *
	 *tt;.        ....::::..              .:.,:           .LDEEEKKKKKKKKKKKKWWWWKWWWWWWWWWWKKKKWtKKiDWWWKKKEEEEKi:..DEDDDDDDiiWKEEEEEEEEEEDDEijDEEEEEKEEEEEEEEEEEEWWEEGDDDGGLG.       .:,;;iijLGGGDDDDDDDDDDDD *
	 *tt;.          .....:::..            ...,.           .fEEEEKKKKKKKKWKKKKWWWWWWWWWWWWWWKWKKKiKDiLWWWWKEEEEEi,..fD:DDDDDti;WEEEEEEEEEEKDDi:iDDEEEEWEEEEEEEEEEEE#WEEGDDDDGGG.         :,iitjLGGGDDDDDDDDDDDD *
	 *tti.            .....:::..          ...,.           GDEEEKKKKKKKKKWKKKWWW#WWWWWWWWWWWKWKKjiEjitWWWKKWEEEDi...DDLDDDDji;;WEEEEEEEEEEEDEj.iDDEEEEWEEEEEEEEEEEEWWEEDDDDDDGf.          .,;tjfLGGDDDDDDDDDDDD *
	 *tti.              ....::::..        ...,.           fEEEKKKKKKKKKKKKKKKW#WWWWWWWWWWWWWWWWtiEiiiWWWKKEWKEi....D.EDDDEi;.fWEEEEEEEEEEDDfL.;EDDEEEWEEEEEEEEEEEEWWEEEDDDDDGf.           :;ijfLGGDDDDDDDDDDDD *
	 *tti.                ....::::..      ...,.          LDEEEKKKKKKKKKKKKKKWWWWWWWWWWWWWWWW####WKiiiWWWKKKEEK,...:E:DDDEii..GWEEEEEEEEDWDDiL.,KDDEEEWEEEEEEEEEEEEWWKEEDDDDDGf:           .,itfLGGDDDDDDDDDDDD *
	 *tti.                 .....:::..     ...,.          fDEEEKKKKKKKKKWKKKKWWWWWWWWWWWWW########WLiiWWWKKKEEjD...G,DDDDi;...EWEEEEEEEEDKDEii..LDDEEEWEEEEEEEEEEEEWWWEEDDDDDGfi           .,;tfLGGGDDDDDDDDDDD *
	 *tti.                   .....:::..   ...,.         iGEEEKKKKKKKKKKWKKKKWWWWWWWWWWWW###########KiWWWKKEEE,.D..D.DDDii:...KKEEEEEEEEEDDj:...tEDEEEWEEEEEEEEEEEEWWWEEEDDDDDLL           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                     ....::::......:.         LEEEKKKKKKKKKKWWKKKWWW#KWWWWWWWW#####W####W##KWWKKEEL..:D.jjDDi;,....KKEEEEEEEDfDDi...:iKDEEEWKEEEEEEEEEEEWWWEEEEDDDDLG           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                        ...::::::..,.        :GEEEKKKKKKKKKKKKWWWWW##WWWWWWWWW##WKWK#W#W####WWKEEK.....G.DDti,.....KKEEEEEEDWGDf.,...iKDEEEWWEEEEEEEEEEEW#WEEEEEDDDGL           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                         ....::::::,.        GDEEKKKKKKKKKKKKKWWWW###WWWWWWWWWW#WWWK###W#####WKEKK.....jDDL;;......KKEEEEEEEEEDi.f...;KDEEEWWEEEEEEEEEEEWWWWEEEEEDDGf           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                           ....:::,,.       .LEEEKKKKKWKKKKKWWWWWW###WWWWWWWWWW#WWKW#WW##W#WWWKEKD:....:DD:;......;KEEEEEEEKiDD..f...,KKEEEWWEEEEEEEEEEEWWWWEEEEEDDDf           .:;tjLLGGGDDDDDDDDDD *
	 *tti.                             ...::,,,:.     GDEEKKKKKKKKKKKKWWWWWWW#WWWWWWWWWWW#KjKWWWWWWWWWWWWEK.j,..;fD.;.......fKEEEEEDKG:Di..,....DKEEEWWEEEEEEKEKKKWWWWEEEEEEDDf           .:;tjLLGGDDDDDDDDDDD *
	 *jti.                              ...::,,,,:.  .fEEEKKKKKWKKKKKKWWWWWWW#WWWWWWWWWWK#KKKWWWWWWWWWWWWWK..f:.:G.,:.......EKEEEEEKK;:E:.......fKEEEWWKEKEKKKKKKKW#WWEEEEEEDDf:          .,;tfLLGGDDDDDDDDDDD *
	 *tti.                               ...:,,,;;,: iDEEKKKKKWKKKKKKKWWWWWWW#WWWWWWWWWWK#WDKWWKKWWWWWWWWWE..;G:G..,........KKEEEEEKi.Gi..:.....tKEEKWWWKKKKKKKKKKW##WKEEEEEEDfi          .,;tfLLGGGDDDDDDDDDD *
	 *tti.                               ....::,,;;;,LEEKKKKKKWKKKKKWWWWWWW###WWWWWWWWWWKWWDKWEEEWKKWWWWWKKj.:LG..;.........EKEEEEKG;.G...;.....;KKEKWWWKKKKKKKKKKW##WWKEEEEEDfL          .,;tfLGGGDDDDDDDDDDD *
	 *jti.                                ...::::,;ijDEEKKKKKWKKKKKKWKWWWWW##WWWWWWWWWWWKK#KKGDGDWEEWKKWKKGE,.i;.:.........:EKEEEKE;.:L...j.....,KWEKWWWKKKKKKKKKK####WKKEEEEDLG          .,;tfLGGGGDDDDDDDDDD *
	 *jti.                                ...:...,,;GEEKKKKKWWKKKKKWWWWWWWW###WWWWWWWWWKKKWWKiLGGEDEDEKGKKiEG..;...........jKEEEKK;:.G....,.....:KKEWWWWKKKKKKKWKK####WKKKKEEEGL          .,;tfLGGGGDDDDDDDDDD *
	 *jti.                                ...:.  .:,GEEKKKKKWKKKKKWWWWWWWW####WWWWWWWWWKKKWWKii;fDLGDK: EEi:E:.............EKEEKK;;..L...........KKKWWWWKKKKKKKWKK####WKKKWKEEDf          .,;tfGGGGDDDDDDDDDDD *
	 *jti.                                ...:.    ,EEKKKKKWWKKKKKWWWWWWWWW###WWWWWWWWKKKKfWWLt;i,. fi  EG..D:.............EKEKK;;..t....:.......KWKWWWWKKKKKKKWKK####WKKKWEEEDf:.        .,;tfGGGGDDDDDDDDDDD *
	 *jti.                                ...:.    GEEKKKKKWKKKKKWWWWWWWWW####WWWWWWWKKKKKt;KKEfff     .;t.................KKKKi;:..GtGGfG.......KWWWWWWKKKKKKKWKK###WWWKKKKEEEf,,:       .,;tfGGGGDDDDDDDDDDD *
	 *jti.                                ...:.    GEKKKKKWWKKKKKWWWWWWWWWW##WWWWWWWKKKKKKt;EiKKKK,   ...t................jEKKG;;..,.....,LGi....KWWWWWWKKKKKKWKKKW####WKKKKKEEL,,,:.     .,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.  .GEEKKKKKWKKKKKWWWWWWWWWW###WWWWWWWKKKKKKtiE::tGG........................EEEj;;...,.........:D..DKWWWWWWKKKKK#KKW###W#WKKKKKEEfj:,,,:.   .,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.   DEKKKKKWWKKKKKWWWWWWWWW####WWWWWWWKKKKKKiiE:::.::.......................EEi;;...j.....f......:iDKWWWWWWKKKKK#WW######WKKKKKEELG :,,,,:. .,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.  fEEKKKKWWKKKKWWWWWWWWWWW###WWWWWWWWKKKKKK;tE::..........................DD;.;,.::......;........EWWWWWWWKKKKW#WW#####WWKKKWKKELG  .:,,,:::,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:. .DEKEKKKWWKKKKWWWWWWWWWWW###WWWWWWWWKKKKKE,iD::..........................D..,;.,;tLffi...........DWDWWWW#KKKWWWWW#####W#KKKWKEEGL    .:,;,,,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:. ;EEKKKKWWKKKKKWWWWWW#WWWW####WWWWWWKKKKKEL:iD:..........................j ..;..;;:.....i,........DKtWWWWWKKWWWWWW#####WWWKKKEKEDf     .:,;;;itfGGGDDDDDDDDDDDD *
	 *jti.                                ...:. DEKKKKKWWKKKKWWWWWWW#WWWW####WWWWWWKKKKKEj:iG...............................:....................GKiWWWWWKKWW#WWW######WWKKKKKEEf       .,;iitfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.:EKKKKKWWKKKKKWWWWWWW#WWW#####WWWWWKWKKKKEi:if:.................................iEKEKKKKKKDj......DKiWWWWWKWK##WW#######WWKKK:KEEL        .:;itfGGGDDDDDDDDDDDD *
	 *jji.                                ...:,DEEKKKWWWKWKKWWWWWWWWWWWW#####WWWWWWWKKKKEi:it..................................j.  KKKKKKKKKKKf..DKiWWWWWKWW##WW#######WWKKK,KEEf         .,;tfGGGDDDDDDDDDDDD *
	 *jji.                                ..L:iDEEKKKWWKKKKKWWWWWWWWWWWW#####WWWWWKWKKKKKi.i;..................................  . KKKWWWWWWWWK..DGiWWWWWKK##WWW#####W#WWKKKjEKEL,        .:;tfGGGDDDDDDDDDDDD *
	 *jji.                               .f:::EEEKKKWWWKKKKKWWWWWWWWWWWW#####WWWWWKWKKKKK;.i,.................................::  KKEKWWWWWWfWK..EiiWWWWWKWW#WW##########KKKD,KELj        .:;tfGGDDDDDDDDDDDDD *
	 *jji.                             .t::::,DEEKKKWWKKKKWWWWWWWWW#WWWW#####WWWWKKWKKKEK;.i:.................................GDDEEEKKKWWWWWtWWD.E;iWWWWWW###WW#########WWKKK.EEDG        .:;tfGGGDDDDDDDDDDDD *
	 *jji.                          . j..::::EKEKKKWWWKKKKWWWWWWWWW#WWW######WWWWKKWKKKEK;.t:.................................ELLEDDEEEWWWWEtWK,.KiiWWWWWW###W##########WWKKK:EEEG     .;tjfLLGDDDDDDDDDDDDDDD *
	 *jji.                          i.::::::,EEEKKWWWKKKKKWWWWWWWWW#WWW#####WWWWWKWKKKKEE,.t..................................DfiEGDDDEEKKKttKWG.KiiWWWWW##WWW##########WWKKK:fEEL  ,fGGGDDDDDDDDEEEDDDDDDDDDD *
	 *jji.                        .;:..:::::DEEEKKWWWKKKKKWWWWWWWWW#WWWW####WWWWWWWKKKKED,.t..................................ifjDDGGEGDKK.ttKKE.DiWWWWW###WW##########WWWKKK:.KELiLGGGGDDDDDDDDDDDDEEEDDDDDDD *
	 *jji.                       i.:.::::::,KEEKKWWWKKKKKKWWWWWWWWW#WWWW####WWWWWWWKKKKEL:.j..................................GGf,;ifLLED .iiKKi:fWWWWWW##W#W##########WWWKKK:.KKLGGDDDDDDDDDDDDDDDDEDDEEDDDDD *
	 *jji.                     .j:.::::::::EEEKKKWWWKKKKKKWWWWWWWW##WWW#####WWWWWWWKKKKKf:.f..................................:EEfftf .,. ;iE,..jWWWWWWW###W############WWKKK,:KKGDDDDDDDDDDDDDDDDDDDDDDDEDDDD *
	 *jji.                    .:.::::::::,,EEEKKWWWKKKKKKKWWWWWWWW##WWW#####WWWWWWWKKKKKt..G....................................EEELL;   .j....tKWWWWWWW################WWWKKtfGKGEDDDDDDDDDDDDDDDDDDDDDDDEEDD *
	 *jji.                   :...:::::::,,jEEKKWWWWKKKKKKWWWWWWWWW##KWW#####KWWWWWWKKKKEi..D....................................:jEEE.........;KKWWWWWWWW#WW##W##########WWKKDLGKEKDDDDDDDDDDDDDDDDDDDDDDDDDED *
	 *jji.                  i:.::::::::,,,EEEKKWWWWKKKKKWWWWWWWWWW##WWW#####WWWWWWWKKKKKi..D......................................:::::......,KKKWWWWWWWWW#####W########WWWKKKGGKKEGGGGGGGGDDDDDDDDDDDDDDDDDDE *
	 *jji.                 i..:::::::::,,tEEKKWWWWKKKKKWWWWWWWWWWW##WW######WWWWWWWKKKKKi..D......................................::::......:EKKKWWWWWWWWWWW##WW########W#WKKWGGKKGGGGGGGGGGGGGGGDDDDDDDDDDDDD *
	 *jji.                .:::::::::::,,,EEEKKWWWWKKKKKWWWWWWWWWWW##WW#####WWWWWWWWKKKKKi..D....................................:::::::::..tELii;KWWWWWWWWWW##WW######WWWWWWKWGGGKGGGGGGGGGGGGGGGGGGGGGGGGGGDG *
	 *jjt.                :.::::::::,,,,fEEKKWWWWKKKKKKWWWWWWWWWW###WW####WWWWWWW#WKKKKKi..D....................................:::::::.:.,;;;;;;,KKWWWWWWWWW#WW########WWWKKWGGGKGGGGGGGGGGGGGGGGGGGGGGGGGGGG *
	 *jji.               ;.::::::::,,,,;EEEKWWWWWKKKKKWWWWWWWWWWWW##WW###WKWWWWWK#WKKKKKi..G......................................:::::::,;;;;:...KKKWWWWWWWWWKWW#######WWWWKKGLGKDGGGGGGLLGGGGGGGGGGGGGGGGGGG *
	 *jjt.              f.:::::::::,,,,fEEKKWWWWWKKKKKWWWWWWWWWWW###WW##WKKWWWWWW#WKKKKK;.jt........i.............................:::::::;j;;....:E.KKKWWWWWWWKWW#####W#WWWWKKLLGWEEGGGGGLGGGGGGGGGGGGGGGGGGGG *
	 *jjt.             ...:::::::,,,,,;DEEKWWWWWKKKKKWWWWWWWWWWWW####WWWKKKWWWWWWWWKKKKK;.E;.........t.............................:::::ii;;.....D...KKWWWWWWWKWW#####WWEWWWKKGGGEKKGGGGGLGGGGGGGGGGGGGLGGGGGG *
	 *fji.             ;.:::::::,,,,,;LEEKKWWWWWKKKKKWWWWWWWWWWWW####KWKKKKWWWWWWWWKKKKKi.D;..........j.............................:::tt;,.....:.....KKWWWWWWKWWWW##WWWGWWWKKGGGGKEGGGGGGGGGGGGGGGGGGGLLGGGGL *
	 *fji.            t::::::::,,,,,,;EEEKWWWWWKKKKKKKWWWWWWWWWWW##WKWKKKKKWWWWWWWWKKKKKi:D;............j...........................::LL;,.............KKWWWWWKWWWWWWWWWGWWWKKGGGGKGGGGGGGGGGGGGGGGGGGGLLGGGGL *
	 *fjt:            .:::::::,,,,,,,DEEKWWWWWWKKKKKKKWWWWWWWWWWWWKKWKKKKKKWWWWK#WWKKKKWitE;........... ............................:G;;:...............KKKWWKKWWWWWWWWWGWWWKKGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGL *
	 *fjji;:.       .f:::::::,,,,,,,;EEEKWWWWWWKKKKKKWWWWWWWWWWWKKKKKKKKKKKWWKWWWWWKKKKWGKD;........................................L;;..................DKKWKKWWWWWWWWWGWWWKKDGGGKDGGGGGGGGGGGGGGGGGGGGGGGGGG *
	 *fjjtii;,:.     :::::::,,,,,,,;EEEKWWWWWWKKKKKKWWWWWWWWWWKKKKKKKKKKKKWWWWWW#WWKKKKWiEj;......................................:i,;....,...............;KKEKWWWWWWWWWGKWWKKDDGGDEGGGDGGGGGDGGGGGGGGGGGGGGGG *
	 *fjtiiiii;;:.  j::::::,,,,,,,;;EEEKWWWWW#KKKKKWWWWWWWWWKKKKKKWKKKKKKKWWWWWWWWWKKKKWtEL;:....................................;;;:...,;j................:KEEWWWWWWWWWDDWWKKDDDDDKDDDDDDDDDDDDDDDGGGGGGGGGGG *
	 *fjti;;iiii;;,:::::::,,,,,,,,;EEEKWWWWWWWKKKKWWWWWWWWKKKKKKKWKKKKKKKWWWWWWW#W#KKKKWEEii;...................................f;:....,;L...................EEKWWWWWWWWDDWWKKDDDDDKEDDDDDDDDDDDDDDDDDDDDDGGGG *
	 *fjt,,,;;;;ii;f::::::,,,,,,,;;EEKWWWWWWWKKKKKWWWKWWKKKKKKKKKKKKKKKKKWWWWWWW#W#KKKKWKEij;:...............................:G;,.....,;f....................:tKKWWWWWWWDDWWKKDDDDDKKDDDDDDDDDDDDDDDDDDDDDDDDD *
	 *jjt. ..:,;;;;,::::,,,,,,,,;;GEEWWWWWWWWKKKKWKKWKKKKKKKKKKKKKKKKKKKKWWWWWWW#W#KKKKWEDi;j;............................,Li;L;;;..,;;f........................KKKKWWWKDDWWKKDDDGDKKGGGGGGGGDGDDDDDDDDDDDDDDD *
	 *fjt.    .:,,,:::::,,,,,,,;;;EEKWWWWWWWKKKKKKWKKKKKKKKKKKKKKKKKKKKKWKKKWKW##W#KKKKWEti;;G;........................tEEEL;;;;;;;;;;L..........................DKKKKKEDDWWKEDGftiLE;;;;itjLGGGGGGDDDDDDDDDDD *
	 *fjt.       .j::::,,,,,,,;;;DEEWWWWWWWWKKKKWKKKKKKKKKKKKKKKKKKKKKKKWKKWWWK##W#KKKKKEii;;;L;...................iDEEEEEEKKi;j;;;;jD.....:......................,KKKKDGGEKKE:::::;E::::::::::,tLGGDDDDDDDDDD *
	 *fjt.       .;:::,,,,,,,;;;;EEKWWWWWWWWKWKKKKKKKKKKKKKKKWKKKKKKKKKKWKKWWWW#WW#KKKKKKii;;;;f;.............:tDEEEEEKKKKKKKKEti;;;L...............................EEKf;:iKKE::::::E::::::::::::::ifDDDDDDDDD *
	 *fjt:        :::,,,,,,,,;;;DEEWWWWWWWWWEKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKWWWW####KKKKKEiii;;;;f,.........iDEEEEKKKKKKKKKKKKKKKf;iG......i..........................fK::::KKE::::::E::::::::::::::::,tGGDDDDD *
	 *fjt:       t:::,,,,,,;;;;iDEKWWWWWWKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKWWWW####WKKKKLiii;;;;;L,....,Li;EDEEEEKKKKKKKKKKKKKKKKiG......;:...........................:i:::KKE:::::,E,::::::::::::::::::iGDDDD *
	 *jjt.       f::,,,,,,,;;;;GEEWWWWKEEKEKKKKKKKKKKKKKKKKWKKKKKKKKKKKWWKWWWWW###WWKKKKiii;;;;;;;G,;L;;iiEEEEEEEKKKKKKKKKKKKKWWKE......;t.........:....................j::KEE:,::,,D,,::::,,,,,,:::::::::tDDD *
	 *fjt:.      ,::,,,,,,,;;;;EEWWKEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKWWKKWWWWW#W#KKKKKKiiiiii;;;;;i;;iiiEEKEEKKWKKKKKKKWKKKKKWWWGi;...;t......,;;;;,....................:,EEE,,,,,,D,,,,,,,,,,,,,,,,::,::::tG *
	 *fjt:.     ,::,,,,,,,;;;;DEKEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWW#W#KKKKKKiiiii;;i;;;;;iiiKKKEKKKKWWKWWWWWWKKKKWWWWW;;;:;L.....;;;;;;;;;....................,KEE,,,,,,E,,,,,,,,,,,,,,,,,,,,,,,,; *
	 *fjt:.     f:,,,,,,,;;;;jEDEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWW#W##KKKKKKiiiiiiii;i;;iiiEKKKKKKKKWKWWWWWWWWKKKWWWWWKi;;i.....,jEEfGi;;;;;...................EED,,,,,,E,,,,,,,,,,,,,,,,,,,,,,,,, *
	 *fjt:.    .f::,,,,,,;;jEEDEEEEEEEEEEKKKKKKKKKKKKKKKWKKKKKKKKKKKKKWWWKWWWWW###KKKKKLiiiiiiiiiiiiiiEEKKKKKKKKWWWWWWWWWWWWKWWWWWWGi;i;,..;jDDDKEGi;;;;;;:................EED,,,,,,D,,,,,,,,,,,,,,,,,,,,,,,,, *
	 *fjt:.  .. ;::,,,,,;;EDDEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKW#WW####KWKKKiiiiiiiiiiiiijKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWt;i;;;;i;DDDDDDGi;;;;;;;;:.............EDf;,,,;,G;;;;;;;;;;;;;;;,,,,,,,,,, *
	 *fjt:......:,,,,,,;LDDDEEEEEEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKKKWWWWKWWWW####KKKKKiiiiiiiiiiijKEKKWKKKKKKKWWWWWWWWWWWWWWWWWWWWWWiLiii;i;DEEEEDDE;i;;;;;;;;;:..........EDi,;;;;;L;;;;;;;;;;;;;;;;;;,,,,,,, *
	 *fjt:......:,,,,,;EDDDEEKEEEEEEEEEKKKKKKKKKKKKKKKWKKKKKKKKKKKKKKWWWWKKWWW##W#KWKKWEiiiiiijGKKKKKWWKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWKi;iiiiDDEEEEEEDEi;;;;;;;;;;;;;,:.....ED;;;;;;;j;;;;;;;;;;;;;;;;;;;;;;;,, *
	 *fjt:.....t,,,,,;DDDDEEEKEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWKKKWWWW##WKWKKWKiiiKKKKKKKKKWWKKKKKKKKWWWWWWWWWWWWWWW#WWWWWWWWWiiiiifLEEEEEEEEDi;i;;;;;;;;;;;;.....DD;;;;;;;i;;;;;;;;;;;;;;;;;;;;;;;;; *
	 *fjt:.....G,,,,,GDDDEEEEEEEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKKKKKWWWKKKWWW###WKWKKWKitKKKKKKKKKWKKKKKKKKKKWWWWWWWWWWWWWW###WWWWWWWWEiiiiiiiEEEEEEEEDGiiii;;;;;;;;;.....GD;;;;;;;i;;;;;;;;;;;;;;;;;;;;;;;;; *
	 *fjt:.....L,,,,;GDDDEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWDGWWW###KKWWKWKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWW####WWWWWWWWWiiiiiiiiEEEEEEEEEEDi;i;;;;;;;;.....Lj;;;;;;i;iiiiii;;;;;;ii;;;;;;;;;;; *
	 ***********************************************************************************************************************************************************************************************************/

	void sort(int a[]) {
		ArrayList<Integer> list=new ArrayList<>();
		for(int x: a) list.add(x);
		Collections.sort(list);
		for(int i=0;i<a.length;i++) a[i]=list.get(i);
	}
	void sort(long a[]) {
		ArrayList<Long> list=new ArrayList<>();
		for(long x: a) list.add(x);
		Collections.sort(list);
		for(int i=0;i<a.length;i++) a[i]=list.get(i);
	}
	void ruffleSort(int a[]) {
		Random rand=new Random();
		int n=a.length;
		for(int i=0;i<n;i++) {
			int j=rand.nextInt(n);
			int temp=a[i];
			a[i]=a[j];
			a[j]=temp;
		}
		Arrays.sort(a);
	}
	void ruffleSort(long a[]) {
		Random rand=new Random();
		int n=a.length;
		for(int i=0;i<n;i++) {
			int j=rand.nextInt(n);
			long temp=a[i];
			a[i]=a[j];
			a[j]=temp;
		}
		Arrays.sort(a);
	}

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next() {
            while (st==null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String s="";
            try {
                s=br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }
    }

	long fact[];
	long invFact[];
	void init(int n) {
		fact=new long[n+1];
		invFact=new long[n+1];
		fact[0]=1;
		for(int i=1;i<=n;i++) {
			fact[i]=mul(i,fact[i-1]);
		}
		invFact[n]=power(fact[n],mod-2);
		for(int i=n-1;i>=0;i--) {
			invFact[i]=mul(invFact[i+1],i+1);
		}
	}

	long nCr(int n, int r) {
		if(n<r || r<0) return 0;
		return mul(fact[n],mul(invFact[r],invFact[n-r]));
	}

	long mul(long a, long b) {
		return a*b%mod;
	}
	long add(long a, long b) {
		return (a+b)%mod;
	}

	long power(long x, long y) {
		long gg=1;
		while(y>0) {
			if(y%2==1) gg=mul(gg,x);
			x=mul(x,x);
			y/=2;
		}
		return gg;
	}

    // Functions
	static long gcd(long a, long b) {
		return b==0?a:gcd(b,a%b);
	}
	static int gcd(int a, int b) {
		return b==0?a:gcd(b,a%b);
	}

	void print(int a[]) {
		int n=a.length;
		for(int i=0;i<n;i++) out.print(a[i]+" ");
	}

	void print(long a[]) {
		int n=a.length;
		for(int i=0;i<n;i++) out.print(a[i]+" ");
	}

    //Input Arrays
    static void input(long a[], int n) {
		for(int i=0;i<n;i++) {
			a[i]=inp.nextLong();
		}
	}
	static void input(int a[], int n) {
		for(int i=0;i<n;i++) {
			a[i]=inp.nextInt();
		}
	}
	static void input(String s[],int n) {
		for(int i=0;i<n;i++) {
			s[i]=inp.next();
		}
	}
	static void input(int a[][], int n, int m) {
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=inp.nextInt();
			}
		}
	}
	static void input(long a[][], int n, int m) {
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=inp.nextLong();
			}
		}
	}

}


// No sorcery shall prevail. //
import java.util.*;
import java.io.*;
public class InVoker {
	//Variables
	static long mod = 1000000007;
	static long mod2 = 998244353;
	static FastReader inp= new FastReader();
	static PrintWriter out= new PrintWriter(System.out);
	public static void main(String args[]) {
	   	InVoker g=new InVoker();
	   	g.main();
	   	out.close();
	}

	int dp[][];
	int dp2[];
	int freq[][];
	int m;

	//Main
	void main() {

		int n=inp.nextInt();
		m=inp.nextInt();
		String s=inp.next();
		dp=new int[m][1<<m];
		dp2=new int[1<<m];
		Arrays.fill(dp2, -1);
		for(int i=0;i<m;i++) Arrays.fill(dp[i], -1);
		freq=new int[m][m];
		for(int i=0;i<n-1;i++) {
			int x=s.charAt(i)-'a';
			int y=s.charAt(i+1)-'a';
			freq[x][y]++;
			freq[y][x]++;
		}
		out.println(go(0,0));

	}

	int go(int idx, int mask) {
		if(idx==m) return 0;
		if(dp[idx][mask]!=-1) return dp[idx][mask];
		int cost=gogo(mask);
		int gg=Integer.MAX_VALUE;
		for(int i=0;i<m;i++) {
			if((mask>>i&1)==1) continue;
			gg=Math.min(gg, go(idx+1,mask|(1<<i)));
		}
		gg+=cost;
		return dp[idx][mask]=gg;
	}

	int gogo(int mask) {
		if(dp2[mask]!=-1) return dp2[mask];
		int cost=0;
		for(int i=0;i<m;i++) for(int j=i+1;j<m;j++) {
			if(((mask>>i&1)^(mask>>j&1))==1) {
				cost+=freq[i][j];
			}
		}
		return dp2[mask]=cost;
	}

	/*********************************************************************************************************************************************************************************************************
	 * ti;.                               .:,:i:         :,;;itt;.        fDDEDDEEEEEEKEEEEEKEEEEEEEEEEEEEEEEE###WKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWW#WWWWWKKKKKEE      :,:.    f::::. .,ijLGDDDDDDDEEEEEEE*
	 *ti;.                               .:,:i:          .:,;itt;:      GLDEEGEEEEEEEEEEEEEEEEEEDEEEEEEEEEEE#W#WEKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWKKKKKKG.     .::.      f:,...,ijLGDDDDDDDDEEEEEE *
	 *ti;.                               .:,:i:            :,;;iti,    :fDDEEEEEEEEEEEEEEEKEEEEDEEEEEEEEEEEW##WEEEKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWWKKKKKKEG     .::.       .f,::,ijLGDDDDDDDDEEEEEE *
	 *ti;.                               .:,:i:             .,,;iti;.  LDDEEEEEEEEEEKEEEEWEEEDDEEEEEEEEEEE#WWWEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWKKKKKEDj    .::.        .:L;;ijfGDDDDDDDDDEEEEE *
	 *ti;.                               .:,:i:              .:,;;iii:LLDEEEEEEEEEEEKEEEEEEEEDEEEEEEEEEEEW#WWEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKWWKWWWWWWWWWWWWWWKKKKKKKEL    .::.         .:;LijLGGDDDDDDDDEEEEE *
	 *ti;.                               .:,:;:                :,;;ittfDEEEEEEEEEEEEEEEEKEEEGEEEEEEEEEEEKWWWEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWKKKKKKKELj   .::.          :,;jffGGDDDDDDDDDEEEE *
	 *ti;.                               .:,:i:                 .,;;tGGDEEEEEEEEEEEKEEEKEEEDEEEEEEEEEEEEWWWEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWKWWWWWWKKKKKKKEEL   .::.          .:;itDGGDDDDDDDDDEEEE *
	 *ti;.                               .:::;:                   :;ifDEEEEEEEEEEEEKEEEKEEEEEEEEEEEEEEEWWWEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WWWKKKKKKKKEEf   .::.           :,itfGEDDDDDDDDDDDEE *
	 *ti;.                               .:::;:                    :GGEEEEEEEEEEEKEKEEKEEEEEEEEEEEEEEEEWWEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKKKKEEDG  .::.           .,;jfLGKDLDDDDDDEEDD *
	 *ti;.                               .:::;:                     fDEEEEEEKKKKKKKKKEKEEEEEEEEEEEEEEE#WEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#KKKKKKKKKKEEf .:::.           .,;tfLGDEDDDDDDDDEEE *
	 *ti;.                                :::;:                    fDEEEEEEKKKKKKKKKKWKEEEEEEEEEEEEEEEWKEEEEEEEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKW##KKKKKKKKKEEft :::.           .,;tfLGDDDKDDDDDDDDD *
	 *ti;.                                .::;:                    fDEEEEEEKKKKKKKWKKKKKEEEEEEEEEEEEE#WEEWEEEEEDEEDEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKKKEEGG :,:.           .,;tfLGGDDDKDDDDDDDD *
	 *ti;.                                .:.;:                   tGDEEEEKKKKKKKKKKKKKKKKKEEEEEEEEEEEWEEKWEEEEEEEDEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWKKKKKKKEEDf :::.           .,;tfLGGDDDDEDDDDDDD *
	 *ti;.                                .::;:                   fDEEEEEKKKKKKKKKKKWKKKKKKKKEEEEEEEWWEEWEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKW##KKKKKKKEEEft.::.           .,;tfLGGDDDDDDEDDDDD *
	 *ti;.                                .:.;:                  tGDEEEKKKKKKKKKKKKKKKKKKKKKKEKEEEEE#EEWWEEEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKEEEGD:::.           .,;tfLGGDDDDDDDEDDDD *
	 *ti;.                                .:.,.                  LDEEEEKKKKKKKKKKWKWKKKKKKKKKKKKEEEKWEKW#EEEEEEEEEEEEEEEEKEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKW##KKKKKKEEEEf,,:.           .,;tfLGGDDDDDDDDEDDD *
	 *ti;.                               ..:.,.                 LGDEEEEKKKKKKKKKKWKKKKKKKKKKKKKKKKKWEEW#WEEEEEEEEEEEEEEEKEEEEEEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKK##KKKKKEEEEEfi;,.           .,;tfLGGDDDDDDDDDKDD *
	 *tt;.                                .:.,:                 jDEEEEKKKKKKKKKKWWKKKKKKKKKKKKKKKKKWKE#WWEEEEEEEEEEEEEEWEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKWWKKKKEEEEDfG;,:           .,;tfLGGDDDDDDDDDDKD *
	 *tii,.                               .:.,.                tGDEEEEKKKKKKKKKKWWWKKKKKKKKKKKKKKKWKKWWWKEEEEEEEEEEEEEKEEEEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKW#KKKKEEEEDGGi;,.          .,;tfLGGDDDDDDDDDDDE *
	 *ti;;,:.                             .:.,:                fDEEEEKKKKKKKKKKKWKKKKKKKKKKKKKKKKKWEK#WWKEEEEEEEEEEEEDEEEEEEEEEEEEEEGEEEEEEEEEEEEEEEEEEEKKKKKKKWWKKEEEEEEDDf;;;,.         .,;tfLGGDDDDDDDDDDDD *
	 *tii;,,:..                           ...,.               ;LEEEEEKKKKKKWKKKKWKKKKKKKKKKKKKKKKKEKKW#WEEEEEEEEEEEEEjEEEEEEEEEKEEEEGEEEEEEEEEKEEEEEEEEEEEEEEEEE#WKEEEEEEDDf;;;;,:        .,itfLGGDDDDDDDDDDDD *
	 *ti;,,,,,:.                          ...,.               LDEEEEKKKKKKKKKKKWWWKKKKKKKKKKKKKKKWKK#W#WEEEEEEEEEEEDDLEEEEEEEEEWEEEEDEEEEEEEEEKEEEEEEEEEEEEEEEEEWWEEEEEEEDDfj,,,,,:.      .,itfGGGDDDDDDDDDDDD *
	 *tii,,,,::::.                        ...,:              .fDEEEEKKKKKKWKKKKWWWKKKKKKKKKKKKKKKEKKW#WWEEEEEEEEEEEKiKEEKEEEEEEWEEEEDEEEEEEEEEEEEEEEEEEEEEEEEEEEWWEEEEEEEDDLD:::,,,:.     .,ijfGGGDDDDDDDDDDDD *
	 *ti;:::::::::..                      .:.,:              LDEEEEKKKKKKKWKKKKWWKKKKKKKKKKKKKKKKtKKWWWWKEEEEEEEEEDiiDEEEEEEEEWWEEEEEEDEEEEEEEEEEEEEEEEEEEEEEEEEEWKEEEEEDDDGL:. .:,,,:    .,ijLGGGDDDDDDDDDDDD *
	 *tt;. .::::::::..                    ...,:             :fDEEEKKKKKKKKKKKKWW#KKKKKKKKKKKKKKKKfKKWWWWKEEEEEEEEDti,DEKEEEEEEWWEEEDEEEEEEEEEKEEEEEEEEEEEEEDEEEEE#WEEEEEGGDGf:.  .:,;,:.  .,ijLGGDDDDDDDDDDDDD *
	 *tt;.   .:::::::..                   ...,:             GDEEEKKKKKKKKWKKKKWWWKKKWKKKKKKKWWWKDEKLWWWWKKEEEEEEDEi,LDEEEEEEEEWWEEEEEEEEEEEEEEEEEEEEEEEEEDEDEEEEEW#EEEEDDDDGf,.    :,,,:...,ijLGGGDDDDDDDDDDDD *
	 *tt;.    .....::::..                 ...,:             fDEEEKKKKKKKKWKKKKWWWWKKKWKKKKKKKKKKfWKiWWW#KKEEEEEEEi;.EDfEEEDEEiWWEEEEEEEEEEEEDGKEEEEEEEEEEDEEEEEEEWWEEEEDDDGGLi.     .,;,:::,ijLGGGDDDDDDDDDDDD *
	 *tt;.      ....:::::.                ...,.            iDEEEEKKKKKKKKWKKWKWWWWWKKWWWKKKKKKKKtWKt#WWWKKEEEEEDji..DDKDDEDEGiWKEEEEEEEEEEDDEjEEEEEEEEEEEDEEEEEEEKWKEEDDDDGGff.      .:,;,,;ijLGGGDDDDDDDDDDDD *
	 *tt;.        ....::::..              .:.,:           .LDEEEKKKKKKKKKKKKWWWWKWWWWWWWWWWKKKKWtKKiDWWWKKKEEEEKi:..DEDDDDDDiiWKEEEEEEEEEEDDEijDEEEEEKEEEEEEEEEEEEWWEEGDDDGGLG.       .:,;;iijLGGGDDDDDDDDDDDD *
	 *tt;.          .....:::..            ...,.           .fEEEEKKKKKKKKWKKKKWWWWWWWWWWWWWWKWKKKiKDiLWWWWKEEEEEi,..fD:DDDDDti;WEEEEEEEEEEKDDi:iDDEEEEWEEEEEEEEEEEE#WEEGDDDDGGG.         :,iitjLGGGDDDDDDDDDDDD *
	 *tti.            .....:::..          ...,.           GDEEEKKKKKKKKKWKKKWWW#WWWWWWWWWWWKWKKjiEjitWWWKKWEEEDi...DDLDDDDji;;WEEEEEEEEEEEDEj.iDDEEEEWEEEEEEEEEEEEWWEEDDDDDDGf.          .,;tjfLGGDDDDDDDDDDDD *
	 *tti.              ....::::..        ...,.           fEEEKKKKKKKKKKKKKKKW#WWWWWWWWWWWWWWWWtiEiiiWWWKKEWKEi....D.EDDDEi;.fWEEEEEEEEEEDDfL.;EDDEEEWEEEEEEEEEEEEWWEEEDDDDDGf.           :;ijfLGGDDDDDDDDDDDD *
	 *tti.                ....::::..      ...,.          LDEEEKKKKKKKKKKKKKKWWWWWWWWWWWWWWWW####WKiiiWWWKKKEEK,...:E:DDDEii..GWEEEEEEEEDWDDiL.,KDDEEEWEEEEEEEEEEEEWWKEEDDDDDGf:           .,itfLGGDDDDDDDDDDDD *
	 *tti.                 .....:::..     ...,.          fDEEEKKKKKKKKKWKKKKWWWWWWWWWWWWW########WLiiWWWKKKEEjD...G,DDDDi;...EWEEEEEEEEDKDEii..LDDEEEWEEEEEEEEEEEEWWWEEDDDDDGfi           .,;tfLGGGDDDDDDDDDDD *
	 *tti.                   .....:::..   ...,.         iGEEEKKKKKKKKKKWKKKKWWWWWWWWWWWW###########KiWWWKKEEE,.D..D.DDDii:...KKEEEEEEEEEDDj:...tEDEEEWEEEEEEEEEEEEWWWEEEDDDDDLL           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                     ....::::......:.         LEEEKKKKKKKKKKWWKKKWWW#KWWWWWWWW#####W####W##KWWKKEEL..:D.jjDDi;,....KKEEEEEEEDfDDi...:iKDEEEWKEEEEEEEEEEEWWWEEEEDDDDLG           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                        ...::::::..,.        :GEEEKKKKKKKKKKKKWWWWW##WWWWWWWWW##WKWK#W#W####WWKEEK.....G.DDti,.....KKEEEEEEDWGDf.,...iKDEEEWWEEEEEEEEEEEW#WEEEEEDDDGL           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                         ....::::::,.        GDEEKKKKKKKKKKKKKWWWW###WWWWWWWWWW#WWWK###W#####WKEKK.....jDDL;;......KKEEEEEEEEEDi.f...;KDEEEWWEEEEEEEEEEEWWWWEEEEEDDGf           .,;tjLLGGDDDDDDDDDDD *
	 *tti.                           ....:::,,.       .LEEEKKKKKWKKKKKWWWWWW###WWWWWWWWWW#WWKW#WW##W#WWWKEKD:....:DD:;......;KEEEEEEEKiDD..f...,KKEEEWWEEEEEEEEEEEWWWWEEEEEDDDf           .:;tjLLGGGDDDDDDDDDD *
	 *tti.                             ...::,,,:.     GDEEKKKKKKKKKKKKWWWWWWW#WWWWWWWWWWW#KjKWWWWWWWWWWWWEK.j,..;fD.;.......fKEEEEEDKG:Di..,....DKEEEWWEEEEEEKEKKKWWWWEEEEEEDDf           .:;tjLLGGDDDDDDDDDDD *
	 *jti.                              ...::,,,,:.  .fEEEKKKKKWKKKKKKWWWWWWW#WWWWWWWWWWK#KKKWWWWWWWWWWWWWK..f:.:G.,:.......EKEEEEEKK;:E:.......fKEEEWWKEKEKKKKKKKW#WWEEEEEEDDf:          .,;tfLLGGDDDDDDDDDDD *
	 *tti.                               ...:,,,;;,: iDEEKKKKKWKKKKKKKWWWWWWW#WWWWWWWWWWK#WDKWWKKWWWWWWWWWE..;G:G..,........KKEEEEEKi.Gi..:.....tKEEKWWWKKKKKKKKKKW##WKEEEEEEDfi          .,;tfLLGGGDDDDDDDDDD *
	 *tti.                               ....::,,;;;,LEEKKKKKKWKKKKKWWWWWWW###WWWWWWWWWWKWWDKWEEEWKKWWWWWKKj.:LG..;.........EKEEEEKG;.G...;.....;KKEKWWWKKKKKKKKKKW##WWKEEEEEDfL          .,;tfLGGGDDDDDDDDDDD *
	 *jti.                                ...::::,;ijDEEKKKKKWKKKKKKWKWWWWW##WWWWWWWWWWWKK#KKGDGDWEEWKKWKKGE,.i;.:.........:EKEEEKE;.:L...j.....,KWEKWWWKKKKKKKKKK####WKKEEEEDLG          .,;tfLGGGGDDDDDDDDDD *
	 *jti.                                ...:...,,;GEEKKKKKWWKKKKKWWWWWWWW###WWWWWWWWWKKKWWKiLGGEDEDEKGKKiEG..;...........jKEEEKK;:.G....,.....:KKEWWWWKKKKKKKWKK####WKKKKEEEGL          .,;tfLGGGGDDDDDDDDDD *
	 *jti.                                ...:.  .:,GEEKKKKKWKKKKKWWWWWWWW####WWWWWWWWWKKKWWKii;fDLGDK: EEi:E:.............EKEEKK;;..L...........KKKWWWWKKKKKKKWKK####WKKKWKEEDf          .,;tfGGGGDDDDDDDDDDD *
	 *jti.                                ...:.    ,EEKKKKKWWKKKKKWWWWWWWWW###WWWWWWWWKKKKfWWLt;i,. fi  EG..D:.............EKEKK;;..t....:.......KWKWWWWKKKKKKKWKK####WKKKWEEEDf:.        .,;tfGGGGDDDDDDDDDDD *
	 *jti.                                ...:.    GEEKKKKKWKKKKKWWWWWWWWW####WWWWWWWKKKKKt;KKEfff     .;t.................KKKKi;:..GtGGfG.......KWWWWWWKKKKKKKWKK###WWWKKKKEEEf,,:       .,;tfGGGGDDDDDDDDDDD *
	 *jti.                                ...:.    GEKKKKKWWKKKKKWWWWWWWWWW##WWWWWWWKKKKKKt;EiKKKK,   ...t................jEKKG;;..,.....,LGi....KWWWWWWKKKKKKWKKKW####WKKKKKEEL,,,:.     .,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.  .GEEKKKKKWKKKKKWWWWWWWWWW###WWWWWWWKKKKKKtiE::tGG........................EEEj;;...,.........:D..DKWWWWWWKKKKK#KKW###W#WKKKKKEEfj:,,,:.   .,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.   DEKKKKKWWKKKKKWWWWWWWWW####WWWWWWWKKKKKKiiE:::.::.......................EEi;;...j.....f......:iDKWWWWWWKKKKK#WW######WKKKKKEELG :,,,,:. .,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.  fEEKKKKWWKKKKWWWWWWWWWWW###WWWWWWWWKKKKKK;tE::..........................DD;.;,.::......;........EWWWWWWWKKKKW#WW#####WWKKKWKKELG  .:,,,:::,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:. .DEKEKKKWWKKKKWWWWWWWWWWW###WWWWWWWWKKKKKE,iD::..........................D..,;.,;tLffi...........DWDWWWW#KKKWWWWW#####W#KKKWKEEGL    .:,;,,,;tfGGGDDDDDDDDDDDD *
	 *jti.                                ...:. ;EEKKKKWWKKKKKWWWWWW#WWWW####WWWWWWKKKKKEL:iD:..........................j ..;..;;:.....i,........DKtWWWWWKKWWWWWW#####WWWKKKEKEDf     .:,;;;itfGGGDDDDDDDDDDDD *
	 *jti.                                ...:. DEKKKKKWWKKKKWWWWWWW#WWWW####WWWWWWKKKKKEj:iG...............................:....................GKiWWWWWKKWW#WWW######WWKKKKKEEf       .,;iitfGGGDDDDDDDDDDDD *
	 *jti.                                ...:.:EKKKKKWWKKKKKWWWWWWW#WWW#####WWWWWKWKKKKEi:if:.................................iEKEKKKKKKDj......DKiWWWWWKWK##WW#######WWKKK:KEEL        .:;itfGGGDDDDDDDDDDDD *
	 *jji.                                ...:,DEEKKKWWWKWKKWWWWWWWWWWWW#####WWWWWWWKKKKEi:it..................................j.  KKKKKKKKKKKf..DKiWWWWWKWW##WW#######WWKKK,KEEf         .,;tfGGGDDDDDDDDDDDD *
	 *jji.                                ..L:iDEEKKKWWKKKKKWWWWWWWWWWWW#####WWWWWKWKKKKKi.i;..................................  . KKKWWWWWWWWK..DGiWWWWWKK##WWW#####W#WWKKKjEKEL,        .:;tfGGGDDDDDDDDDDDD *
	 *jji.                               .f:::EEEKKKWWWKKKKKWWWWWWWWWWWW#####WWWWWKWKKKKK;.i,.................................::  KKEKWWWWWWfWK..EiiWWWWWKWW#WW##########KKKD,KELj        .:;tfGGDDDDDDDDDDDDD *
	 *jji.                             .t::::,DEEKKKWWKKKKWWWWWWWWW#WWWW#####WWWWKKWKKKEK;.i:.................................GDDEEEKKKWWWWWtWWD.E;iWWWWWW###WW#########WWKKK.EEDG        .:;tfGGGDDDDDDDDDDDD *
	 *jji.                          . j..::::EKEKKKWWWKKKKWWWWWWWWW#WWW######WWWWKKWKKKEK;.t:.................................ELLEDDEEEWWWWEtWK,.KiiWWWWWW###W##########WWKKK:EEEG     .;tjfLLGDDDDDDDDDDDDDDD *
	 *jji.                          i.::::::,EEEKKWWWKKKKKWWWWWWWWW#WWW#####WWWWWKWKKKKEE,.t..................................DfiEGDDDEEKKKttKWG.KiiWWWWW##WWW##########WWKKK:fEEL  ,fGGGDDDDDDDDEEEDDDDDDDDDD *
	 *jji.                        .;:..:::::DEEEKKWWWKKKKKWWWWWWWWW#WWWW####WWWWWWWKKKKED,.t..................................ifjDDGGEGDKK.ttKKE.DiWWWWW###WW##########WWWKKK:.KELiLGGGGDDDDDDDDDDDDEEEDDDDDDD *
	 *jji.                       i.:.::::::,KEEKKWWWKKKKKKWWWWWWWWW#WWWW####WWWWWWWKKKKEL:.j..................................GGf,;ifLLED .iiKKi:fWWWWWW##W#W##########WWWKKK:.KKLGGDDDDDDDDDDDDDDDDEDDEEDDDDD *
	 *jji.                     .j:.::::::::EEEKKKWWWKKKKKKWWWWWWWW##WWW#####WWWWWWWKKKKKf:.f..................................:EEfftf .,. ;iE,..jWWWWWWW###W############WWKKK,:KKGDDDDDDDDDDDDDDDDDDDDDDDEDDDD *
	 *jji.                    .:.::::::::,,EEEKKWWWKKKKKKKWWWWWWWW##WWW#####WWWWWWWKKKKKt..G....................................EEELL;   .j....tKWWWWWWW################WWWKKtfGKGEDDDDDDDDDDDDDDDDDDDDDDDEEDD *
	 *jji.                   :...:::::::,,jEEKKWWWWKKKKKKWWWWWWWWW##KWW#####KWWWWWWKKKKEi..D....................................:jEEE.........;KKWWWWWWWW#WW##W##########WWKKDLGKEKDDDDDDDDDDDDDDDDDDDDDDDDDED *
	 *jji.                  i:.::::::::,,,EEEKKWWWWKKKKKWWWWWWWWWW##WWW#####WWWWWWWKKKKKi..D......................................:::::......,KKKWWWWWWWWW#####W########WWWKKKGGKKEGGGGGGGGDDDDDDDDDDDDDDDDDDE *
	 *jji.                 i..:::::::::,,tEEKKWWWWKKKKKWWWWWWWWWWW##WW######WWWWWWWKKKKKi..D......................................::::......:EKKKWWWWWWWWWWW##WW########W#WKKWGGKKGGGGGGGGGGGGGGGDDDDDDDDDDDDD *
	 *jji.                .:::::::::::,,,EEEKKWWWWKKKKKWWWWWWWWWWW##WW#####WWWWWWWWKKKKKi..D....................................:::::::::..tELii;KWWWWWWWWWW##WW######WWWWWWKWGGGKGGGGGGGGGGGGGGGGGGGGGGGGGGDG *
	 *jjt.                :.::::::::,,,,fEEKKWWWWKKKKKKWWWWWWWWWW###WW####WWWWWWW#WKKKKKi..D....................................:::::::.:.,;;;;;;,KKWWWWWWWWW#WW########WWWKKWGGGKGGGGGGGGGGGGGGGGGGGGGGGGGGGG *
	 *jji.               ;.::::::::,,,,;EEEKWWWWWKKKKKWWWWWWWWWWWW##WW###WKWWWWWK#WKKKKKi..G......................................:::::::,;;;;:...KKKWWWWWWWWWKWW#######WWWWKKGLGKDGGGGGGLLGGGGGGGGGGGGGGGGGGG *
	 *jjt.              f.:::::::::,,,,fEEKKWWWWWKKKKKWWWWWWWWWWW###WW##WKKWWWWWW#WKKKKK;.jt........i.............................:::::::;j;;....:E.KKKWWWWWWWKWW#####W#WWWWKKLLGWEEGGGGGLGGGGGGGGGGGGGGGGGGGG *
	 *jjt.             ...:::::::,,,,,;DEEKWWWWWKKKKKWWWWWWWWWWWW####WWWKKKWWWWWWWWKKKKK;.E;.........t.............................:::::ii;;.....D...KKWWWWWWWKWW#####WWEWWWKKGGGEKKGGGGGLGGGGGGGGGGGGGLGGGGGG *
	 *fji.             ;.:::::::,,,,,;LEEKKWWWWWKKKKKWWWWWWWWWWWW####KWKKKKWWWWWWWWKKKKKi.D;..........j.............................:::tt;,.....:.....KKWWWWWWKWWWW##WWWGWWWKKGGGGKEGGGGGGGGGGGGGGGGGGGLLGGGGL *
	 *fji.            t::::::::,,,,,,;EEEKWWWWWKKKKKKKWWWWWWWWWWW##WKWKKKKKWWWWWWWWKKKKKi:D;............j...........................::LL;,.............KKWWWWWKWWWWWWWWWGWWWKKGGGGKGGGGGGGGGGGGGGGGGGGGLLGGGGL *
	 *fjt:            .:::::::,,,,,,,DEEKWWWWWWKKKKKKKWWWWWWWWWWWWKKWKKKKKKWWWWK#WWKKKKWitE;........... ............................:G;;:...............KKKWWKKWWWWWWWWWGWWWKKGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGL *
	 *fjji;:.       .f:::::::,,,,,,,;EEEKWWWWWWKKKKKKWWWWWWWWWWWKKKKKKKKKKKWWKWWWWWKKKKWGKD;........................................L;;..................DKKWKKWWWWWWWWWGWWWKKDGGGKDGGGGGGGGGGGGGGGGGGGGGGGGGG *
	 *fjjtii;,:.     :::::::,,,,,,,;EEEKWWWWWWKKKKKKWWWWWWWWWWKKKKKKKKKKKKWWWWWW#WWKKKKWiEj;......................................:i,;....,...............;KKEKWWWWWWWWWGKWWKKDDGGDEGGGDGGGGGDGGGGGGGGGGGGGGGG *
	 *fjtiiiii;;:.  j::::::,,,,,,,;;EEEKWWWWW#KKKKKWWWWWWWWWKKKKKKWKKKKKKKWWWWWWWWWKKKKWtEL;:....................................;;;:...,;j................:KEEWWWWWWWWWDDWWKKDDDDDKDDDDDDDDDDDDDDDGGGGGGGGGGG *
	 *fjti;;iiii;;,:::::::,,,,,,,,;EEEKWWWWWWWKKKKWWWWWWWWKKKKKKKWKKKKKKKWWWWWWW#W#KKKKWEEii;...................................f;:....,;L...................EEKWWWWWWWWDDWWKKDDDDDKEDDDDDDDDDDDDDDDDDDDDDGGGG *
	 *fjt,,,;;;;ii;f::::::,,,,,,,;;EEKWWWWWWWKKKKKWWWKWWKKKKKKKKKKKKKKKKKWWWWWWW#W#KKKKWKEij;:...............................:G;,.....,;f....................:tKKWWWWWWWDDWWKKDDDDDKKDDDDDDDDDDDDDDDDDDDDDDDDD *
	 *jjt. ..:,;;;;,::::,,,,,,,,;;GEEWWWWWWWWKKKKWKKWKKKKKKKKKKKKKKKKKKKKWWWWWWW#W#KKKKWEDi;j;............................,Li;L;;;..,;;f........................KKKKWWWKDDWWKKDDDGDKKGGGGGGGGDGDDDDDDDDDDDDDDD *
	 *fjt.    .:,,,:::::,,,,,,,;;;EEKWWWWWWWKKKKKKWKKKKKKKKKKKKKKKKKKKKKWKKKWKW##W#KKKKWEti;;G;........................tEEEL;;;;;;;;;;L..........................DKKKKKEDDWWKEDGftiLE;;;;itjLGGGGGGDDDDDDDDDDD *
	 *fjt.       .j::::,,,,,,,;;;DEEWWWWWWWWKKKKWKKKKKKKKKKKKKKKKKKKKKKKWKKWWWK##W#KKKKKEii;;;L;...................iDEEEEEEKKi;j;;;;jD.....:......................,KKKKDGGEKKE:::::;E::::::::::,tLGGDDDDDDDDDD *
	 *fjt.       .;:::,,,,,,,;;;;EEKWWWWWWWWKWKKKKKKKKKKKKKKKWKKKKKKKKKKWKKWWWW#WW#KKKKKKii;;;;f;.............:tDEEEEEKKKKKKKKEti;;;L...............................EEKf;:iKKE::::::E::::::::::::::ifDDDDDDDDD *
	 *fjt:        :::,,,,,,,,;;;DEEWWWWWWWWWEKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKWWWW####KKKKKEiii;;;;f,.........iDEEEEKKKKKKKKKKKKKKKf;iG......i..........................fK::::KKE::::::E::::::::::::::::,tGGDDDDD *
	 *fjt:       t:::,,,,,,;;;;iDEKWWWWWWKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKWWWW####WKKKKLiii;;;;;L,....,Li;EDEEEEKKKKKKKKKKKKKKKKiG......;:...........................:i:::KKE:::::,E,::::::::::::::::::iGDDDD *
	 *jjt.       f::,,,,,,,;;;;GEEWWWWKEEKEKKKKKKKKKKKKKKKKWKKKKKKKKKKKWWKWWWWW###WWKKKKiii;;;;;;;G,;L;;iiEEEEEEEKKKKKKKKKKKKKWWKE......;t.........:....................j::KEE:,::,,D,,::::,,,,,,:::::::::tDDD *
	 *fjt:.      ,::,,,,,,,;;;;EEWWKEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKWWKKWWWWW#W#KKKKKKiiiiii;;;;;i;;iiiEEKEEKKWKKKKKKKWKKKKKWWWGi;...;t......,;;;;,....................:,EEE,,,,,,D,,,,,,,,,,,,,,,,::,::::tG *
	 *fjt:.     ,::,,,,,,,;;;;DEKEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWW#W#KKKKKKiiiii;;i;;;;;iiiKKKEKKKKWWKWWWWWWKKKKWWWWW;;;:;L.....;;;;;;;;;....................,KEE,,,,,,E,,,,,,,,,,,,,,,,,,,,,,,,; *
	 *fjt:.     f:,,,,,,,;;;;jEDEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWW#W##KKKKKKiiiiiiii;i;;iiiEKKKKKKKKWKWWWWWWWWKKKWWWWWKi;;i.....,jEEfGi;;;;;...................EED,,,,,,E,,,,,,,,,,,,,,,,,,,,,,,,, *
	 *fjt:.    .f::,,,,,,;;jEEDEEEEEEEEEEKKKKKKKKKKKKKKKWKKKKKKKKKKKKKWWWKWWWWW###KKKKKLiiiiiiiiiiiiiiEEKKKKKKKKWWWWWWWWWWWWKWWWWWWGi;i;,..;jDDDKEGi;;;;;;:................EED,,,,,,D,,,,,,,,,,,,,,,,,,,,,,,,, *
	 *fjt:.  .. ;::,,,,,;;EDDEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKW#WW####KWKKKiiiiiiiiiiiiijKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWt;i;;;;i;DDDDDDGi;;;;;;;;:.............EDf;,,,;,G;;;;;;;;;;;;;;;,,,,,,,,,, *
	 *fjt:......:,,,,,,;LDDDEEEEEEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKKKWWWWKWWWW####KKKKKiiiiiiiiiiijKEKKWKKKKKKKWWWWWWWWWWWWWWWWWWWWWWiLiii;i;DEEEEDDE;i;;;;;;;;;:..........EDi,;;;;;L;;;;;;;;;;;;;;;;;;,,,,,,, *
	 *fjt:......:,,,,,;EDDDEEKEEEEEEEEEKKKKKKKKKKKKKKKWKKKKKKKKKKKKKKWWWWKKWWW##W#KWKKWEiiiiiijGKKKKKWWKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWKi;iiiiDDEEEEEEDEi;;;;;;;;;;;;;,:.....ED;;;;;;;j;;;;;;;;;;;;;;;;;;;;;;;,, *
	 *fjt:.....t,,,,,;DDDDEEEKEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWKKKWWWW##WKWKKWKiiiKKKKKKKKKWWKKKKKKKKWWWWWWWWWWWWWWW#WWWWWWWWWiiiiifLEEEEEEEEDi;i;;;;;;;;;;;;.....DD;;;;;;;i;;;;;;;;;;;;;;;;;;;;;;;;; *
	 *fjt:.....G,,,,,GDDDEEEEEEEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKKKKKWWWKKKWWW###WKWKKWKitKKKKKKKKKWKKKKKKKKKKWWWWWWWWWWWWWW###WWWWWWWWEiiiiiiiEEEEEEEEDGiiii;;;;;;;;;.....GD;;;;;;;i;;;;;;;;;;;;;;;;;;;;;;;;; *
	 *fjt:.....L,,,,;GDDDEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWDGWWW###KKWWKWKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWW####WWWWWWWWWiiiiiiiiEEEEEEEEEEDi;i;;;;;;;;.....Lj;;;;;;i;iiiiii;;;;;;ii;;;;;;;;;;; *
	 ***********************************************************************************************************************************************************************************************************/

	void sort(int a[]) {
		ArrayList<Integer> list=new ArrayList<>();
		for(int x: a) list.add(x);
		Collections.sort(list);
		for(int i=0;i<a.length;i++) a[i]=list.get(i);
	}
	void sort(long a[]) {
		ArrayList<Long> list=new ArrayList<>();
		for(long x: a) list.add(x);
		Collections.sort(list);
		for(int i=0;i<a.length;i++) a[i]=list.get(i);
	}
	void ruffleSort(int a[]) {
		Random rand=new Random();
		int n=a.length;
		for(int i=0;i<n;i++) {
			int j=rand.nextInt(n);
			int temp=a[i];
			a[i]=a[j];
			a[j]=temp;
		}
		Arrays.sort(a);
	}
	void ruffleSort(long a[]) {
		Random rand=new Random();
		int n=a.length;
		for(int i=0;i<n;i++) {
			int j=rand.nextInt(n);
			long temp=a[i];
			a[i]=a[j];
			a[j]=temp;
		}
		Arrays.sort(a);
	}

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next() {
            while (st==null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String s="";
            try {
                s=br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }
    }

	long fact[];
	long invFact[];
	void init(int n) {
		fact=new long[n+1];
		invFact=new long[n+1];
		fact[0]=1;
		for(int i=1;i<=n;i++) {
			fact[i]=mul(i,fact[i-1]);
		}
		invFact[n]=power(fact[n],mod-2);
		for(int i=n-1;i>=0;i--) {
			invFact[i]=mul(invFact[i+1],i+1);
		}
	}

	long nCr(int n, int r) {
		if(n<r || r<0) return 0;
		return mul(fact[n],mul(invFact[r],invFact[n-r]));
	}

	long mul(long a, long b) {
		return a*b%mod;
	}
	long add(long a, long b) {
		return (a+b)%mod;
	}

	long power(long x, long y) {
		long gg=1;
		while(y>0) {
			if(y%2==1) gg=mul(gg,x);
			x=mul(x,x);
			y/=2;
		}
		return gg;
	}

    // Functions
	static long gcd(long a, long b) {
		return b==0?a:gcd(b,a%b);
	}
	static int gcd(int a, int b) {
		return b==0?a:gcd(b,a%b);
	}

	void print(int a[]) {
		int n=a.length;
		for(int i=0;i<n;i++) out.print(a[i]+" ");
	}

	void print(long a[]) {
		int n=a.length;
		for(int i=0;i<n;i++) out.print(a[i]+" ");
	}

    //Input Arrays
    static void input(long a[], int n) {
		for(int i=0;i<n;i++) {
			a[i]=inp.nextLong();
		}
	}
	static void input(int a[], int n) {
		for(int i=0;i<n;i++) {
			a[i]=inp.nextInt();
		}
	}
	static void input(String s[],int n) {
		for(int i=0;i<n;i++) {
			s[i]=inp.next();
		}
	}
	static void input(int a[][], int n, int m) {
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=inp.nextInt();
			}
		}
	}
	static void input(long a[][], int n, int m) {
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=inp.nextLong();
			}
		}
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();int g[]=new int[1<<m];
		StringBuffer s=new StringBuffer(sc.next());
		s=s.insert(0, 'A');
		int D=(1<<m)-1;
		for(int i=1;i<n;i++)
		{
			int x=s.charAt(i)-'a',y=s.charAt(i+1)-'a';
			if(x!=y)
				g[1<<x|1<<y]++;
		}
		for(int j=0;j<m;j++)
			for(int i=0;i<=D;i++)
				if((i>>j&1)!=0)
					g[i]+=g[i^1<<j];
		int f[]=new int[1<<m];
		Arrays.fill(f, Integer.MAX_VALUE/2);
		f[0]=0;
		for(int i=0;i<=D;i++)
			for(int j=0;j<m;j++)
				if((i>>j&1)==0)
					f[i|1<<j]=Math.min(f[i|1<<j], f[i]+g[D]-g[i]-g[D^i]);
		System.out.println(f[D]);
	}

}


import java.util.*;
import java.io.*;

public class Main {
	public static void main(String args[]) {new Main().run();}

	FastReader in = new FastReader();
	PrintWriter out = new PrintWriter(System.out);
	void run(){
		out.println(work());
		out.flush();
	}
	long mod=1000000007;
	long gcd(long a,long b) {
		return b==0?a:gcd(b,a%b);
	}
	long work() {
		int n=in.nextInt();
		int m=in.nextInt();
		String str=in.next();
		long[] dp=new long[1<<m];
		long[][] cnt=new long[m][m];
		long[] rec=new long[1<<m];//记录每次移动的一位怎加的值，减少重复计算
		for(int i=1;i<n;i++) {
			int n1=str.charAt(i-1)-'a';
			int n2=str.charAt(i)-'a';
			cnt[n1][n2]++;
			cnt[n2][n1]++;
		}
		for(int i=1;i<1<<m;i++) {
			dp[i]=9999999999L;
			long v=0;
			int b=0;//最低位的1
			for(int j=0;j<m;j++) {
				if((i&(1<<j))>0) {
					b=j;
					break;
				}
			}
			for(int j=0;j<m;j++) {
				if((i&(1<<j))==0) {
					v+=cnt[b][j];
				}else {
					if(b!=j)v-=cnt[b][j];
				}
			}
			v+=rec[i-(1<<b)];
			for(int j=0;j<m;j++) {
				if((i&(1<<j))>0) {
					dp[i]=Math.min(dp[i], dp[i-(1<<j)]+v);
				}
			}
			rec[i]=v;
		}

		return dp[(1<<m)-1];
	}
}

class FastReader
{
	BufferedReader br;
	StringTokenizer st;

	public FastReader()
	{
		br=new BufferedReader(new InputStreamReader(System.in));
	}

	public String next()
	{
		if(st==null || !st.hasMoreElements())
		{
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	public int nextInt()
	{
		return Integer.parseInt(next());
	}

	public long nextLong()
	{
		return Long.parseLong(next());
	}
}


import java.util.*;
import java.io.*;

public class Main {
	public static void main(String args[]) {new Main().run();}

	FastReader in = new FastReader();
	PrintWriter out = new PrintWriter(System.out);
	void run(){
		out.println(work());
		out.flush();
	}
	long mod=1000000007;
	long gcd(long a,long b) {
		return b==0?a:gcd(b,a%b);
	}
	long work() {
		int n=in.nextInt();
		int m=in.nextInt();
		String str=in.next();
		long[] dp=new long[1<<m];
		long[][] cnt=new long[m][m];
		for(int i=1;i<n;i++) {
			int n1=str.charAt(i-1)-'a';
			int n2=str.charAt(i)-'a';
			cnt[n1][n2]++;
			cnt[n2][n1]++;
		}
		for(int i=1;i<1<<m;i++) {
			dp[i]=9999999999L;
			long v=0;
			for(int j=0;j<m;j++) {
				if((i&(1<<j))>0) {//第j个字母
					for(int k=0;k<m;k++) {
						if((i&(1<<k))==0) {
							v+=cnt[j][k];
						}
					}
				}
			}
			for(int j=0;j<m;j++) {
				if((i&(1<<j))>0) {
					dp[i]=Math.min(dp[i], dp[i-(1<<j)]+v);
				}
			}
		}

		return dp[(1<<m)-1];
	}
}

class FastReader
{
	BufferedReader br;
	StringTokenizer st;

	public FastReader()
	{
		br=new BufferedReader(new InputStreamReader(System.in));
	}

	public String next()
	{
		if(st==null || !st.hasMoreElements())
		{
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	public int nextInt()
	{
		return Integer.parseInt(next());
	}

	public long nextLong()
	{
		return Long.parseLong(next());
	}
}


#pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;

#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 1e5 + 5;
const int inf = 1e9 + 7;

int cnt[26][26], p[26], dp[1<<20];

signed main() {
    IOS;
    #ifdef LOCAL
        freopen("input.txt","r", stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n, m;
    cin >> n >> m;
    string s;   cin >> s;
    for(int i = 0; i < n-1; i++){
        if(s[i] == s[i+1])  continue;
        cnt[s[i]-'a'][s[i+1]-'a']++;
        cnt[s[i+1]-'a'][s[i]-'a']++;
    }
    p[0] = 1;
    for(int i = 1; i < 26; i++)
        p[i] = (p[i-1] << 1);
    for(int mask = 1; mask < p[20]; mask++){
        dp[mask] = inf;
        for(int j = 0; j < 20; j++){
            if(mask & p[j]){
                int cur = 0;
                int x = __builtin_popcountll(mask);
                for(int k = 0; k < 20; k++){
                    if(mask & p[k])
                        cur += x*cnt[j][k];
                    else
                        cur -= x*cnt[j][k];
                }
                dp[mask] = min(dp[mask], dp[mask^p[j]] + cur);
            }
        }
    }
    cout << dp[p[20]-1];
    return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
using namespace std;

#define ll long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 1e5 + 5;
const int inf = 1e9 + 7;

int cnt[26][26], p[26], dp[1<<21];

signed main() {
    IOS;
    #ifdef LOCAL
        freopen("input.txt","r", stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n, m;
    cin >> n >> m;
    string s;   cin >> s;
    for(int i = 0; i < n-1; i++){
        if(s[i] == s[i+1])  continue;
        cnt[s[i]-'a'][s[i+1]-'a']++;
        cnt[s[i+1]-'a'][s[i]-'a']++;
    }
    p[0] = 1;
    for(int i = 1; i < 26; i++)
        p[i] = (p[i-1] << 1);
    for(int mask = 1; mask < p[20]; mask++){
        dp[mask] = inf;
        for(int j = 0; j < 20; j++){
            if(mask & p[j]){
                int cur = 0;
                int x = __builtin_popcount(mask);
                for(int k = 0; k < 20; k++){
                    if(mask & p[k])
                        cur += x*cnt[j][k];
                    else
                        cur -= x*cnt[j][k];
                }
                dp[mask] = min(dp[mask], dp[mask^p[j]] + cur);
            }
        }
    }
    cout << dp[p[20]-1];
    return 0;
}


#pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;

#define ll long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 1e5 + 5;
const int inf = 1e9 + 7;

int cnt[26][26], p[26], dp[1<<21];

signed main() {
    IOS;
    #ifdef LOCAL
        freopen("input.txt","r", stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n, m;
    cin >> n >> m;
    string s;   cin >> s;
    for(int i = 0; i < n-1; i++){
        if(s[i] == s[i+1])  continue;
        cnt[s[i]-'a'][s[i+1]-'a']++;
        cnt[s[i+1]-'a'][s[i]-'a']++;
    }
    p[0] = 1;
    for(int i = 1; i < 26; i++)
        p[i] = (p[i-1] << 1);
    for(int mask = 1; mask < p[20]; mask++){
        dp[mask] = inf;
        for(int j = 0; j < 20; j++){
            if(mask & p[j]){
                int cur = 0;
                int x = __builtin_popcount(mask);
                for(int k = 0; k < 20; k++){
                    if(mask & p[k])
                        cur += x*cnt[j][k];
                    else
                        cur -= x*cnt[j][k];
                }
                dp[mask] = min(dp[mask], dp[mask^p[j]] + cur);
            }
        }
    }
    cout << dp[p[20]-1];
    return 0;
}


#pragma GCC optimize "03"
#include "bits/stdc++.h"
using namespace std;

#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 1e5 + 5;
const int inf = 1e9 + 7;

int cnt[26][26], p[26], dp[1<<20];

signed main() {
    IOS;
    #ifdef LOCAL
        freopen("input.txt","r", stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n, m;
    cin >> n >> m;
    string s;   cin >> s;
    for(int i = 0; i < n-1; i++){
        if(s[i] == s[i-1])  continue;
        cnt[s[i]-'a'][s[i+1]-'a']++;
        cnt[s[i+1]-'a'][s[i]-'a']++;
    }
    p[0] = 1;
    for(int i = 1; i < 26; i++)
        p[i] = (p[i-1] << 1);
    for(int mask = 1; mask < p[20]; mask++){
        dp[mask] = inf;
        for(int j = 0; j < 20; j++){
            if(mask & p[j]){
                int cur = 0;
                int x = __builtin_popcountll(mask);
                for(int k = 0; k < 20; k++){
                    if(mask & p[k])
                        cur += x*cnt[j][k];
                    else
                        cur -= x*cnt[j][k];
                }
                dp[mask] = min(dp[mask], dp[mask^p[j]] + cur);
            }
        }
    }
    cout << dp[p[20]-1];
    return 0;
}


#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int num,start = 1, sum = 0;;

		vector<int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > A[start - 1]){
					int t = sol.size() ;
					sol[t-1] = A[start] ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
		//	cout<<sol[k]<<endl ;
			sum = sum + sol[k] ;
		}

	//	cout<<"\nthe sum is "<<sum ;
		cout<<sum<<endl;
	}
	return 0;
}


#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<long long int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int start = 1 ;
		long long int sum = 0;

		vector<long long int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > A[start - 1]){
					int t = sol.size() ;
					sol[t-1] = A[start] ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
			sum = sum + sol[k] ;
		}

		cout<<sum<<endl;
	}
	return 0;
}


#include <iostream>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int num,start = 1, sum = 0;;

		vector<int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > A[start - 1]){
					int t = sol.size() ;
					sol[t-1] = A[start] ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
		//	cout<<sol[k]<<endl ;
			sum = sum + sol[k] ;
		}

	//	cout<<"\nthe sum is "<<sum ;
		cout<<endl<<sum<<endl;
	}
	return 0;
}


#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int start = 1 ;
		long int sum = 0;

		vector<int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > A[start - 1]){
					int t = sol.size() ;
					sol[t-1] = A[start] ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
			sum = sum + sol[k] ;
		}

		cout<<sum<<endl;
	}
	return 0;
}


#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int num,start = 1, sum = 0;;

		vector<int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > A[start - 1]){
					int t = sol.size() ;
					sol[t-1] = A[start] ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
			sum = sum + sol[k] ;
		}

		cout<<sum<<endl;
	}
	return 0;
}


#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int start = 1 ;
		double sum = 0;

		vector<int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > A[start - 1]){
					int t = sol.size() ;
					sol[t-1] = A[start] ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
			sum = sum + sol[k] ;
		}

		cout<<sum<<endl;
	}
	return 0;
}


#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int num,start = 1, sum = 0;;

		vector<int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > A[start - 1]){
					int t = sol.size() ;
					sol[t-1] = A[start] ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
			sum = sum + sol[k] ;
		}

		cout<<endl;
	}
	return 0;
}


#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int start = 1 ;
		long long int sum = 0;
		int max = A[0] ;

		vector<int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
				max = A[start] ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > max){
					max = A[start] ;
					int t = sol.size() ;
					sol[t-1] = max ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
			sum = sum + sol[k] ;
		}

		cout<<sum<<endl;
	}
	return 0;
}


#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<long long int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int start = 1 ;
		long long int sum = 0;
		long long int max = A[0] ;

		vector<long long int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
				max = A[start] ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > max){
					max = A[start] ;
					int t = sol.size() ;
					sol[t-1] = max ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
			sum = sum + sol[k] ;
		}

		cout<<sum<<endl;
	}
	return 0;
}


#include <iostream>
#include <cmath>
#include<vector>
using namespace std;

int main(){
	int t;
	cin>>t;
	for (int i=0;i<t;i++){
		int n;
		cin>>n ;

		vector<int> A(n,0) ;

		for (int i = 0;i<n;i++){
			cin>>A[i] ;
		}

		int start = 1 ;
		long long int sum = 0;

		vector<int> sol ;

		sol.push_back(A[0]) ;

		for(start ; start < n; start++){

			if ((A[start] * A[start-1]) < 0){
				sol.push_back(A[start]) ;
			}

			if ((A[start] * A[start-1]) > 0){
				if (A[start] > A[start - 1]){
					int t = sol.size() ;
					sol[t-1] = A[start] ;
				}
			}

		}

		for (int k = 0; k<sol.size() ; k++){
			sum = sum + sol[k] ;
		}

		cout<<sum<<endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int sgn(int x) {
	if (x > 0) return 1;
	else return -1;
}
int main() {
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		vector<int> a(n);
		for (auto &it : a) cin >> it;
		long long sum = 0;
		for (int i = 0; i < n; ++i) {
			int cnt = a[i];
			int j = i;
			while (j < n && sgn(a[i]) == sgn(a[j])) {
				cnt = max(cnt, a[j]);
				j++;
			}
			sum += cnt;
			i = j - 1;

		}
		cout << sum << "\n";
	}
	return 0;
}


#include <string>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
typedef long long int lli;
int t;

int main()
{
	cin >> t;
	while (t--) {

		int n;
		cin >> n;
		vector<lli> v(n);
		for (auto& i : v)
			cin >> i;

		lli sum = 0;
		lli cand = -1000000001;
		for (int i = 0; i < v.size(); ++i) {
			if (i > 0 && ((v[i] > 0 && v[i - 1] < 0) || (v[i] < 0 && v[i - 1] > 0))) {
				sum += cand;
				cand = -1000000001;
			}
			if (v[i] > cand)
				cand = v[i];
		}
		sum += cand;

		cout << sum << "\n";
	}
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
vector<int> V[200001];
int main()
{
	int t;
	cin >> t;
	while (t--) {

		int n;
		cin >> n;
		vector<int> v(n);

		for (auto& i : v)
			cin >> i;

		memset(V, 0, sizeof(V));
		int idx = 0;
		for (int i = 0; i < v.size() - 1; ++i) {
			if ((v[i] > 0 && v[i + 1] < 0) || (v[i] < 0 && v[i + 1] > 0)) {
				V[idx].push_back(v[i]);
				idx++;
			}
			else
				V[idx].push_back(v[i]);
		}
		if ((v[v.size() - 2] > 0 && v[v.size() - 1 < 0]) || (v[v.size() - 2] < 0 && v[v.size() - 1 > 0])) {
			V[idx].push_back(v[v.size() - 1]);
		}
		long long sum = 0;
		for (int i = 0; i <= idx; ++i) {
			sort(V[i].begin(), V[i].end());
			sum += V[i][V[i].size() - 1];
		}
		cout << sum << "\n";
	}

	return 0;
}


#include <string>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;

int t;

int main()
{
	cin >> t;
	while (t--) {

		int n;
		cin >> n;
		vector<int> v(n);
		for (auto& i : v)
			cin >> i;

		int sum = 0;
		int cand = -987654321;
		for (int i = 0; i < v.size(); ++i) {
			if (i > 0 && ((v[i] > 0 && v[i - 1] < 0) || (v[i] < 0 && v[i - 1] > 0))) {
				sum += cand;
				cand = -987654321;
			}
			if (v[i] > cand)
				cand = v[i];
		}
		sum += cand;

		cout << sum << "\n";
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int sgn(int x) {
	if (x > 0) return 1;
	else return -1;
}
int main() {
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		vector<int> a(n);
		for (auto &it : a) cin >> it;
		long long sum = 0;
		int lo = 0, hi = 0;
		int cur = a[lo];
		while (lo < n) {
			if (hi < n && sgn(a[lo]) == sgn(a[hi])) {
				cur = max(cur, a[hi++]);
			}
			else {
				sum += cur;
				lo = hi;
				if (lo >= n) break;
				cur = a[lo];
			}
		}
		cout << sum << "\n";
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int sgn(int x) {
	if (x > 0) return 1;
	else return -1;
}
int main() {
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		vector<int> a(n);
		for (auto &it : a) cin >> it;
		long long sum = 0;
		for (int i = 0; i < n; ++i) {
			int cnt = a[i];
			int j = i;
			while (j < n && sgn(a[i] == sgn(a[j]))) {
				cnt = max(cnt, a[j]);
				j++;
			}
			sum += cnt;
			i = j - 1;

		}
		cout << sum << "\n";
	}
	return 0;
}


#include <iostream>

int main() {
	int q{};
	std::cin >> q;

	while (q--) {
		int n{}, k{};
		long long sum{};
		long long positive_MAX{ 0 }, negative_MAX{ INT_MIN };

		std::cin >> n;

		while (n--) {
			std::cin >> k;

			if (k > positive_MAX) {
				positive_MAX = k;
				if (negative_MAX != INT_MIN) {
					sum += negative_MAX;
					negative_MAX = INT_MIN;
				}
				continue;
			}

			if (k < 0 && k > negative_MAX) {
				negative_MAX = k;
				if (positive_MAX != 0) {
					sum += positive_MAX;
					positive_MAX = 0;
				}
				continue;
			}
		}

		if (positive_MAX > 0)
			sum += positive_MAX;

		if (negative_MAX > INT_MIN)
			sum += negative_MAX;

		std::cout  << sum << "\n";
	}

	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <deque>
#include <algorithm>
#include <ctype.h>
#include <string>
#include <map>
#include <numeric>
#include <set>

using namespace std;

int main() {
	int t;
	cin >> t;
	int n;
	while (t--) {
		cin >> n;
		int a;
		//int maxLength = 1;
		// start counting from the first input
		cin >> a;
		bool startPositive = (a > 0) ? true : false;
		bool isPositive = startPositive;

		int maxLength = 1;
		int localMax = a;
		vector<int> v; // for storing all potential max elements
		for (int i = 1; i < n; i++) {
			cin >> a;
			if ((a < 0 && isPositive) || (a > 0 && !isPositive)) {
				// sign change
				maxLength++;
				isPositive = !isPositive;
				v.push_back(localMax);
				localMax = a;
			}
			else {
				// no sign change
				localMax = max(localMax, a);
			}
		}
		// add the last element
		if (v.size() != maxLength) {
			v.push_back(localMax);
		}

		//cout << "max length = " << maxLength << "\n";
		// sum up vector
		cout << accumulate(v.begin(), v.end(), 0ll) << "\n";
	}

}


#pragma once
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<complex>
#include<fstream>
#include<iostream>
#include<map>
#include<queue>
#include<stack>
#include<set>
#include<string>
#include<utility>
#include<vector>
#pragma warning(disable:4996 6031 6385 6386 6297 26451)
#define go(a,b,c,d) for(int a=b;a<=c;a+=d)
#define sgo(a,b) for(auto a:b)
#define lson root<<1
#define rson lson|1
#define Mid int m=((l+r)>>1)
#define ls lson,l,m
#define rs rson,m+1,r
#define rt 1,1,n
#define INF32 0x7f7f7f7f
#define INF64 0x7f7f7f7f7f7f7f7f
#define r(x) return x
#define rv return
#define pii pair<int,int>
#define pll pair<ll,ll>
#define int long long
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
int t, n, a[200001];
class A {
public:
	priority_queue<int>q;
};
vector<A>v;
signed main() {
	cin >> t;
	while (t--) {
		v.clear();
		cin >> n;
		go(i, 1, n, 1) {
			cin >> a[i];
			if (a[i] * a[i - 1] <= 0) {
				priority_queue<int>tmp;
				tmp.push(a[i]);
				v.push_back({ tmp });
			}
			else
				v.back().q.push(a[i]);
		}
		int ans = 0;
		sgo(i, v)
			ans += i.q.top();
		cout << ans << endl;
	}
	return 0;
}


#include <iostream>
#include<vector>
#include <algorithm>
#include<string>
#include <set>
using namespace std;
void solve() {
	int n;
	cin >> n;
	vector<int>v;
	for (int i = 0; i < n; i++) {
		int temp;
		cin >> temp;
		v.push_back(temp);
	}
	long long int s = 0;
	long long int pf = 0;
	long long int nf = 0;
	int pmax = INT_MIN;
	int nmax = INT_MIN;
	for (int i = 0; i < v.size(); i++) {
		if (v[i] > 0) {
			if (nf == 1) {
				s = s + nmax;
				nmax = INT_MIN;
				nf = 0;
			}
			pmax = max(pmax, v[i]);
			pf = 1;

		}
		if (v[i] < 0) {
			if (pf == 1) {
				s = s + pmax;
				pmax = INT_MIN;
				pf = 0;
			}
			nmax = max(nmax, v[i]);
			nf = 1;

		}

	}
	if (pf == 1) {
		s = s + pmax;
		pmax = INT_MIN;
		pf = 0;
	}
	if (nf == 1) {
		s = s + nmax;
		nmax = INT_MIN;
		nf = 0;
	}

	cout << s << endl;

}

int main() {
	int t; cin >> t;
	while (t--)
		solve();
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
using namespace std;

// C. Alternating Subsequence
// https://codeforces.com/contest/1343/problem/C

auto sgn = [&](int x) {
	if (x > 0)
		return 1;
	else
		return -1;
};

void solve(int n, vector<int>& a)
{
	int sum = 0;
	for (int i=0; i<n; i++)
	{
		int cur = a[i];
		int j = i;
		while (j<n && sgn(a[j])==sgn(a[i]))
		{
			cur = max<int>(cur, a[j]);
			j++;
		}
		sum += cur;
		i = j - 1;
	}
	cout << sum << endl;
}

int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
	ifstream in("inputC.txt");
	cin.rdbuf(in.rdbuf()); //redirect cin to input.txt!
	ofstream out("outC.txt");
	cout.rdbuf(out.rdbuf()); //redirect cout to out.txt!
#endif

	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		vector<int> a(n);
		for (int i=0; i<n; i++)
		{
			cin >> a[i];
		}
		solve(n, a);
	}
	return 0;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
using namespace std;

// C. Alternating Subsequence
// https://codeforces.com/contest/1343/problem/C

auto sgn = [&](int x) {
	if (x > 0)
		return 1;
	else
		return -1;
};

void solve(int n, vector<int>& a)
{
	long long sum = 0;
	for (int i=0; i<n; i++)
	{
		int cur = a[i];
		int j = i;
		while (j<n && sgn(a[j])==sgn(a[i]))
		{
			cur = max<int>(cur, a[j]);
			j++;
		}
		sum += cur;
		i = j - 1;
	}
	cout << sum << endl;
}

int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
	ifstream in("inputC.txt");
	cin.rdbuf(in.rdbuf()); //redirect cin to input.txt!
	ofstream out("outC.txt");
	cout.rdbuf(out.rdbuf()); //redirect cout to out.txt!
#endif

	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		vector<int> a(n);
		for (int i=0; i<n; i++)
		{
			cin >> a[i];
		}
		solve(n, a);
	}
	return 0;
}


#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int num;
	cin >> num;

	for (int i = 0; i < num; i++) {
		int n;

		cin >> n;
		vector<int> input(n, 0);
		long long ans = 0;
		int max_int = 0;
		bool first = true;
		for (int j = 0; j < n; j++) {
			cin >> input[j];

			if (first) {
				max_int = input[j];
				first = false;
			}

			if (max_int * input[j] < 0) {
				ans += max_int;
				max_int = input[j];
			}
			else {
				max_int = max(input[j], max_int);
			}
			if (j == n - 1) {
				ans += max_int;
			}
		}
		cout << ans << endl;

	}
}


#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int num;
	cin >> num;

	for (int i = 0; i < num; i++) {
		int n;

		cin >> n;
		vector<long long> input(n, 0);
		long long ans = 0;
		long long max_int = 0;
		bool first = true;
		for (int j = 0; j < n; j++) {
			cin >> input[j];

			if (first) {
				max_int = input[j];
				first = false;
			}

			if (max_int * input[j] < 0) {
				ans += max_int;
				max_int = input[j];
			}
			else {
				max_int = max(input[j], max_int);
			}
			if (j == n - 1) {
				ans += max_int;
			}
		}
		cout << ans << endl;
	}
}


#include<iostream>
#include<string.h>
using namespace std;

long long num,n,ans=0;
long long a[200050];

int main(){
	cin>>num;
	for(int tk=1;tk<=num;tk++){
		ans=0;
		cin>>n;
		for(int i=1;i<=n;i++) cin>>a[i];
		for(int i=1;i<=n;){
			long long tmp=-1e9;
			if(a[i]>0){
				while(a[i]>0&&i<=n){
					tmp=tmp>a[i]?tmp:a[i];i++;
				}
			}
			else{
				while(a[i]<0&&i<=n){
					tmp=tmp>a[i]?tmp:a[i];i++;
				}
			}
			ans+=tmp;
		}
		cout<<ans<<endl;
	}

	return 0;
}


#include<iostream>
#include<string.h>
using namespace std;

long long num,n,ans=0;
long long a[200050];

int main(){
	cin>>num;
	for(int tk=1;tk<=num;tk++){
		ans=0;
		cin>>n;
		for(int i=1;i<=n;i++) cin>>a[i];
		for(int i=1;i<=n;){
			long long tmp=-1e9;
			if(a[i]>0){
				while(a[i]>0&&i<=n){
					tmp=max(tmp,a[i]);i++;
				}
			}
			else{
				while(a[i]<0&&i<=n){
					tmp=max(tmp,a[i]);i++;
				}
			}
			ans+=tmp;
		}
		cout<<ans<<endl;
	}

	return 0;
}


#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int t,n;
scanf("%d",&t);

for(int i=0;i<t;i++){
	scanf("%d",&n);
	long long *a =(long long*)malloc(n*sizeof(long long));
	long long m,s=0,kt=0;
	for(int i=0;i<n;i++){
		scanf("%lld",a+i);
	}
	m=a[0];
	for(int i=0;i<n-1;i++){

		if(*(a+i) * *(a+i+1)>0){
			if(*(a+i+1)>m) m=*(a+i+1);
		}
		else {
			s=s+m;
			m=*(a+i+1);
		}

	}
	s=s+m;
	printf("%lld\n",s);
}

return 0;
}


#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int t,n;
scanf("%d",&t);

for(int i=0;i<t;i++){
	scanf("%d",&n);
	int *a =(int*)malloc(n*sizeof(int));
	int m,s=0,kt=0;
	for(int i=0;i<n;i++){
		scanf("%d",a+i);
	}
	m=a[0];
	for(int i=0;i<n-1;i++){
		if(*(a+i)* *(a+i+1)>0){
			m=(*(a+i)>*(a+i+1))?*(a+i):*(a+i+1);
		}
		else{
			kt=1;
			s=s+m;
		}
		if(kt==0){
			s=m;
		}

	}
	printf("%d\n",s);
}

return 0;
}


#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int t,n;
scanf("%d",&t);

for(int i=0;i<t;i++){
	scanf("%d",&n);
	long long *a =(long long*)malloc(n*sizeof(long long));
	long long m,s=0,kt=0;
	for(int i=0;i<n;i++){
		scanf("%lld",a+i);
	}
	m=a[0];
	for(int i=0;i<n-1;i++){

		if(*(a+i) * *(a+i+1)>0){
			m=(*(a+i)>*(a+i+1))?*(a+i):*(a+i+1);
		}
		else {
			s=s+m;
			m=*(a+i+1);
		}

	}
	s=s+m;
	printf("%lld\n",s);
}

return 0;
}


#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int t,n;
scanf("%d",&t);

for(int i=0;i<t;i++){
	scanf("%d",&n);
	int *a =(int*)malloc(n*sizeof(int));
	int m,s=0,kt=0;
	for(int i=0;i<n;i++){
		scanf("%d",a+i);
	}
	m=a[0];
	for(int i=0;i<n-1;i++){
		if(*(a+i)* *(a+i+1)>0){
			m=(*(a+i)>*(a+i+1))?*(a+i):*(a+i+1);
		}
		else{
			kt=1;
			s=s+m;
		}
		if(kt==0){
			s=m;
		}

	}
	printf("%d",s);
}

return 0;
}


#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int t,n;
scanf("%d",&t);

for(int i=0;i<t;i++){
	scanf("%d",&n);
	int *a =(int*)malloc(n*sizeof(int));
	int m,s=0,kt=0;
	for(int i=0;i<n;i++){
		scanf("%d",a+i);
	}
	m=a[0];
	for(int i=0;i<n-1;i++){

		if(*(a+i) * *(a+i+1)>0){
			m=(*(a+i)>*(a+i+1))?*(a+i):*(a+i+1);
		}
		else {
			s=s+m;
			m=*(a+i+1);
		}

	}
	s=s+m;
	printf("%d",s);
}

return 0;
}


#include<iostream>
using namespace std;
int main(){
long long a,n,sum,b,c;
cin>>a;
while(a--){cin>>n;sum=0;cin>>b;n--;while(n--){cin>>c;if(b*c>0){if(c>b)b=c;}
    else
    {sum+=b;b=c;}}
cout<<sum+b<<endl;}
return 0;
}


#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int t,n;
scanf("%d",&t);

for(int i=0;i<t;i++){
	scanf("%d",&n);
	int *a =(int*)malloc(n*sizeof(int));
	int m,s=0,kt=0;
	for(int i=0;i<n;i++){
		scanf("%d",a+i);
	}
	m=a[0];
	for(int i=0;i<n-1;i++){

		if(*(a+i) * *(a+i+1)>0){
			m=(*(a+i)>*(a+i+1))?*(a+i):*(a+i+1);
		}
		else {
			s=s+m;
			m=*(a+i+1);
		}

	}
	s=s+m;
	printf("%d\n",s);
}

return 0;
}


#include<iostream>;
#include<vector>;
#include<algorithm>;
typedef long long ll;
using namespace std;
vector<int> stack;

int main() {
	ios::sync_with_stdio(0);
	int T;cin >> T;
	int n, num;
	while (T--) {
		cin >> n;
		cin >> num;
		stack.push_back(num);
		for (int i = 1;i < n;i++) {
			cin >> num;
			if ( num>0 and stack.back()>0 || num<0 and stack.back()<0)
				stack.back() = max(stack.back(), num);
			else stack.push_back(num);
		}
		ll ans = 0;
		while (!stack.empty()) { ans += stack.back();stack.pop_back(); }
		cout << ans << endl;
	}
}


#include<iostream>;
#include<algorithm>;
using namespace std;
typedef long long ll;
ll ans = 0;

int main() {
	ios::sync_with_stdio(0);
	int t;cin >> t;int n;int tmp1,tmp2;
	while (t--) {
		cin >> n;
		cin >> tmp1;n--;
		while (n--) {
			cin >> tmp2;
			if ((tmp2 ^ tmp1) < 0)ans += tmp1, tmp1 = tmp2;
			else tmp1 = max(tmp1, tmp2);
		}
		ans += tmp1;
		cout << ans << endl;
		ans = 0;
	}
}


#include<iostream>;
#include<vector>;
#include<algorithm>;
typedef long long ll;
using namespace std;
vector<int> stack;

int main() {
	ios::sync_with_stdio(0);
	int T;cin >> T;
	int n, num;
	while (T--) {
		cin >> n;
		cin >> num;
		stack.push_back(num);
		for (int i = 1;i < n;i++) {
			cin >> num;
			if ((num>0 and stack.back()>0)||(num<0 and stack.back()<0))
				stack.back() = max(stack.back(), num);
			else stack.push_back(num);
		}
		ll ans = 0;
		for (int i : stack)ans += i;
		cout << ans << endl;
		while (!stack.empty())stack.pop_back();
	}
}


#include<iostream>
using namespace std;

int bmm(long long int a, long long int b)
{
	if(b==0) return a;
	return bmm(b,b%a);
}

int main()
{
	int t;

	cin>>t;
	long long a,b,q,lj,rj,tmp,k;
	for(int i=0;i<t;i++)
	{
		cin>>a>>b>>q;
		for(int j=0;j<q;j++)
		{
			k=0;
			cin>>lj>>rj;
			for(int x=lj;x<=rj;x++)
			{
				if((x%a)%b == (x%b)%a) k++;
			}
			cout<<rj-lj-k+1<<" ";
		}
		cout<<endl;

	}

	return 0;
}


#include<iostream>
using namespace std;

int main()
{
	int t;
	cin>>t;
	long long int sum,last_max,a;
	int n;

	for(int i=0;i<t;i++)
	{
		cin>>n;
		cin>>last_max;
		sum=last_max;

		for(int j=1;j<n;j++)
		{
			cin>>a;
			if(a*last_max<0)
			{
				last_max=a;
				sum+=a;
			}
			else
			{
				if(last_max>=a) continue;
				else
				{
					sum-=last_max;
					sum+=a;
					last_max=a;
				}
			}
		}
		cout<<sum<<endl;

	}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <utility>
#include <set>
#include <deque>
#include <list>
#include <map>
#include <numeric>

using namespace std;

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        vector<long> vec(n);
        for (int i = 0; i < n; ++i)
        {
            cin >> vec[i];
        }
       /* if (count_if(vec.begin(), vec.end(), [](int el) { return el > 0; }) == 0)
        {
            cout << *max_element(vec.begin(), vec.end()) << endl;
            continue;
        }*/
        int l = 0;
        long max_sum = LONG_MIN;
        int prev = 0;
        for (int r = 0; r < n; ++r)
        {
            if (vec[r] * vec[prev] > 0)
            {
                l = r;
            }
            if (l != r || vec[r] < 0)
            {
                max_sum = max(max_sum, (long)accumulate(vec.begin() + l, vec.begin() + r + 1, 0L));
            }
            prev = r;
        }
        cout << max_sum << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <utility>
#include <set>
#include <deque>
#include <list>
#include <map>
#include <numeric>

using namespace std;

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        vector<long long> vec(n);
        for (int i = 0; i < n; ++i)
        {
            cin >> vec[i];
        }
       /* if (count_if(vec.begin(), vec.end(), [](int el) { return el > 0; }) == 0)
        {
            cout << *max_element(vec.begin(), vec.end()) << endl;
            continue;
        }*/
        int l = 0;
        long long max_sum = LONG_MIN;
        int prev = 0;
        int max_size = 1;
        for (int r = 0; r < n; ++r)
        {
            if (vec[r] * vec[prev] > 0)
            {
                l = r;
            }
            if (r - l + 1 >= max_size)
            {
                long long sum = 0;
                for (int i = l; i <= r; ++i)
                {
                    sum += vec[i];
                }
                if (r - l + 1 == max_size)
                {
                    max_sum = max(max_sum, sum);
                }
                else if (r - l + 1 > max_size)
                {
                    max_size = r - l + 1;
                    max_sum = sum;
                }
            }
            prev = r;
        }
        cout << max_sum << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <utility>
#include <set>
#include <deque>
#include <list>
#include <map>
#include <numeric>

using namespace std;

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        vector<long long> vec(n);
        for (int i = 0; i < n; ++i)
        {
            cin >> vec[i];
        }
        long long max_sum = 0;
        for (int r = 0; r < n; ++r)
        {
            long long max_sub = vec[r];
            int l = r;
            while (l < n && vec[l] * vec[r] > 0)
            {
                max_sub = max(max_sub, vec[l++]);
            }
            max_sum += max_sub;
            r = l - 1;
        }
        cout << max_sum << endl;
    }
    return 0;
}


#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        long long tt;
        cin>>tt;
        long long num=0;
        for(int i=0;i<n-1;i++)
        {
            long long t=0;
            cin>>t;
            if((tt>0&&t>0)||(tt<0&&t<0))
            {
                if(t>tt)
                {
                    tt=t;
                }
            }
            else
            {
                num+=tt;
                tt=t;
            }
            if(i==n-2)
            {
                if(tt*t>0)
                    num+=tt;
            }
        }
        if(n==1)
            cout<<tt<<endl;
        else
        cout<<num<<endl;
    }
return 0;
}


#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        long long tt;
        cin>>tt;
        long long num=0;
        for(int i=0;i<n-1;i++)
        {
            long long t=0;
            cin>>t;
            if(tt*t>0)
            {
                if(t>tt)
                {
                    tt=t;
                }
            }
            else
            {
                num+=tt;
                tt=t;
            }
            if(i==n-2)
            {
                if(tt*t>0)
                    num+=tt;
            }
        }
        cout<<num<<endl;
    }
return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
const int MAX_N = 2e5 + 100;

int N;
int A[MAX_N];

void getInput(){
    scanf("%d", &N);
    for (int i = 0; i < N; i++){
        scanf("%d", &A[i]);
    }
}

void solve(){
    bool status = A[0] > 0; // <0 => false | >0 => true
    ll Sum = 0;
    int i = 0;
    while ( i < N ) {
        int target = A[i];
        while ( i + 1 < N && A[i + 1] > 0 == status ){
            target = max(target, A[i + 1]);
            i++;
        }
        Sum += target;
        status = !status;
        i++;
    }
    printf("%lld\n", Sum);
}

int main(){
    int t;scanf("%d", &t);
    while (t--){
        getInput();
        solve();
    }

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int main()
{
	int t, new_el, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		long long sum = 0;
		long long max_el = 0;
		cin >> n;
		for (int j = 0; j < n; j++)
		{
			cin >> new_el;
			if (j == 0)
			{
				max_el = new_el;
			}
			if (max_el * new_el < 0)
			{
				sum += max_el;
				max_el = new_el;
			}
			else if (new_el > max_el)
			{
				max_el = new_el;
			}
		}
		cout << sum + max_el << "\n";
	}
}


#include <iostream>
#include <vector>
using namespace std;

int main()
{
	int t, new_el, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		int cnt = 0;
		long long sum = 0;
		int max_el = 0;
		cin >> n;
		for (int j = 0; j < n; j++)
		{
			cin >> new_el;
			if (j == 0)
			{
				max_el = new_el;
			}
			if (max_el * new_el < 0)
			{
				cnt++;
				sum += max_el;
				max_el = new_el;
			}
			else if (new_el > max_el)
					max_el = new_el;
		}
		cout << sum + max_el << "\n";
	}
}


#include <iostream>
#include <algorithm>

using namespace std;

int main(void)
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);

	int test_case;
	cin >> test_case;

	for (int i = 0; i < test_case; i++)
	{
		int n;
		long long int sum = 0;

		cin >> n;

		int *arr = new int[n] {0, };
		bool check; //true - > + false - > -

		for (int i = 0; i < n; i++)
			cin >> arr[i];

		if (arr[0] < 0)
			check = false;
		else
			check = true;

		int temp = arr[0];

		for (int index = 1; index < n; index ++ )
		{
			if (check == false)
			{
				if (arr[index] > 0)
				{
					sum += temp;
					temp = arr[index];
					check = true;
				}
				else
				{
					temp = max(arr[index], temp);
				}
			}
			if (check == true)
			{
				if (arr[index] < 0)
				{
					sum += temp;
					temp = arr[index];
					check = false;
				}
				else
				{
					temp = max(arr[index], temp);
				}
			}

		}

		cout << sum + temp << "\n";

	}

	return 0;

}


#include <iostream>
#include <algorithm>

using namespace std;

int main(void)
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);

	int test_case;
	cin >> test_case;

	for (int i = 0; i < test_case; i++)
	{
		int n;
		long long int sum = 0;

		cin >> n;

		int *arr = new int[n] {0, };
		bool check; //true - > + false - > -

		for (int i = 0; i < n; i++)
			cin >> arr[i];

		if (arr[0] < 0)
			check = false;
		else
			check = true;

		int temp = arr[0];

		for (int index = 1; index < n; index ++ )
		{
			if (check == false)
			{
				if (arr[index] > 0)
				{
					sum += temp;
					temp = arr[index];
					check = true;
				}
				else
				{
					temp = max(arr[index], temp);
				}
			}
			if (check == true)
			{
				if (arr[index] < 0)
				{
					sum += temp;
					temp = arr[index];
					check = false;
				}
				else
				{
					temp = max(arr[index], temp);
				}
			}

			if (index == n - 1)
				sum += temp;
		}

		cout << sum << "\n";

	}

	return 0;

}


#include <iostream>
int main(){
    int num;
    std::cin>>num;
    for(int i=0;i<num;i++){
        int size;
        std::cin>>size;
        int* set=new int[size];
        for(int j=0;j<size;j++){
            std::cin>>set[j];
        }
        bool pos=false;
        if(set[0]>0) {
            pos=true;
        }
        long long tally=0;
        int track=-1000000001;
        for(int k=0;k<size;k++){
            if(pos){
                if(set[k]>track) {
                    track=set[k];

                }
            }
            else{
                if(set[k]>track) {
                    track=set[k];

                }
            }
            if(k!=size-1){
                if((pos&&set[k+1]<0)||(!pos&&set[k+1]>0)){

                    tally+=track;

                    track=-1000000001;
                    pos=!pos;
                }

            }
            else {
                tally+=track;

            }

        }
        std::cout<<tally<<std::endl;
    }
}


#include<iostream>
#define ll long long
using namespace std;
ll a[200005];
int main(){
	int t;cin>>t;
	while(t--){
		int n;cin>>n;
		for(int i=1;i<=n;i++) cin>>a[i];
		ll ans=0,maxi=a[1];
		bool f,f1;
		if(a[1]>0) f=true;
		else f=false;
		for(int i=1;i<=n;i++){
			if(a[i]>0) f1=true;
			else f1=false;
			if(f&&f1||!f&&!f1) maxi=max(a[i],maxi);
			else{
				ans+=maxi;maxi=a[i];f=f1;
			}
		}
		ans+=maxi;
		cout<<ans<<endl;
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#define ll long long
using namespace std;
ll a[200005];
int main(){
	int t;cin>>t;
	while(t--){
		int n;cin>>n;
		for(int i=1;i<=n;i++) cin>>a[i];
		ll ans=0,maxi=a[1];
		bool f,f1;
		if(a[1]>0) f=true;
		else f=false;
		for(int i=1;i<=n;i++){
			if(a[i]>0) f1=true;
			else f1=false;
			if(f&&f1||!f&&!f1) maxi=max(a[i],maxi);
			else{
				ans+=maxi;maxi=a[i];f=f1;
			}
		}
		ans+=maxi;
		cout<<ans<<endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>
#include <bitset>

long long k, h, c, T, temp, m, N;
long long a[2*100000+1];

int main() {
	std::cin >> T;
	for (int t = 1; t <= T; ++t) {
		long long out = 0;
		std::cin >> N;
		for (int n = 0; n < N; ++n)
			std::cin >> a[n];
		long long runMax = -1000000001;
		long long currVal = a[0];
		for (int n = 1; n < N; ++n) {
			if ((a[n] > 0 && currVal < 0) || (a[n] < 0 && currVal > 0)) {
				out += currVal;
				currVal = a[n];
			}
			else {
				currVal = std::max(currVal, a[n]);
			}
		}
		out += currVal;
		std::cout << out << std::endl;
	}
}


#include<iostream>
#include<vector>
using namespace std;
int main()
{
	int t, n, p;
	long long s;
	vector<int> a;
	cin >> t;
	for (int i = 0; i < t; ++i)
	{
		s = 0;
		a.clear();
		cin >> n;
		for (int j = 0; j < n; ++j)
		{
			cin >> p;
			if (a.empty() || p * a[a.size() - 1] < 0)
			{
			     a.push_back(p);
			     s += p;
			}
			else if (p > a[a.size() - 1] && p * a[a.size() - 1] > 0)
			{
				s -= a[a.size() - 1];
				s += p;
				a.pop_back();
				a.push_back(p);
			}

		}
		cout << s << '\n';
	}
}


#include<iostream>
#include<vector>
using namespace std;
int main()
{
	int t, n, p;
	long long s;
	vector<int> a;
	cin >> t;
	for (int i = 0; i < t; ++i)
	{
		s = 0;
		a.clear();
		cin >> n;
		for (int j = 0; j < n; ++j)
		{
			cin >> p;
			if (a.empty() || (long long)p * (long long)a[a.size() - 1] < 0)
			{
			     a.push_back(p);
			     s += p;
			}
			else if (p > a[a.size() - 1] && (long long)p * (long long)a[a.size() - 1] > 0)
			{
				s -= a[a.size() - 1];
				s += p;
				a.pop_back();
				a.push_back(p);
			}

		}
		cout << s << '\n';
	}
}


#include<iostream>
#include<string>
#include<string.h>
#include<math.h>
#include<vector>
#include<algorithm>
#include<limits.h>

using namespace std;
typedef long long ll;

int main(){
//	ios::sync_with_stdio(0);
//	cin.tie(0);

	ll t,n,cur,S,H;
	cin>>t;
	while(t--){
		S=0;
		H=-32768;
		cin>>n;
		while(n--){
			cin>>cur;
			if(H==-32768){
				H=cur;
			}
			if((cur>0 && H>0) || (cur<0 && H<0)){
				if(cur>H){
					H=cur;
				}
			}
			else{
				S+=H;
				H=cur;
			}
		}
		S+=H;
		cout<<S<<"\n";
	}

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<math.h>
#include<vector>
#include<algorithm>
#include<limits.h>

using namespace std;
typedef long long ll;

int main(){
//	ios::sync_with_stdio(0);
//	cin.tie(0);

	ll t,n,cur,S,H;
	cin>>t;
	while(t--){
		S=0;
		H=-9223372036854775808;
		cin>>n;
		while(n--){
			cin>>cur;
			if(H==-9223372036854775808){
				H=cur;
			}
			if((cur>0 && H>0) || (cur<0 && H<0)){
				if(cur>H){
					H=cur;
				}
			}
			else{
				S+=H;
				H=cur;
			}
		}
		S+=H;
		cout<<S<<"\n";
	}

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<math.h>
#include<vector>
#include<algorithm>
#include<limits.h>

using namespace std;
typedef long long ll;

int main(){
//	ios::sync_with_stdio(0);
//	cin.tie(0);

	ll t,n,cur,S,H;
	cin>>t;
	while(t--){
		S=0;
		H=-3276;
		cin>>n;
		while(n--){
			cin>>cur;
			if(H==-3276){
				H=cur;
			}
			if((cur>0 && H>0) || (cur<0 && H<0)){
				if(cur>H){
					H=cur;
				}
			}
			else{
				S+=H;
				H=cur;
			}
		}
		S+=H;
		cout<<S<<"\n";
	}

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<math.h>
#include<vector>
#include<algorithm>
#include<limits.h>

using namespace std;
typedef long long ll;

int main(){
//	ios::sync_with_stdio(0);
//	cin.tie(0);

	ll t,n,cur,S,H;
	cin>>t;
	while(t--){
		S=0;
		H=-3276;
		cin>>n;
		while(n--){
			cin>>cur;
			if(H==-32768){
				H=cur;
			}
			if((cur>0 && H>0) || (cur<0 && H<0)){
				if(cur>H){
					H=cur;
				}
			}
			else{
				S+=H;
				H=cur;
			}
		}
		S+=H;
		cout<<S<<"\n";
	}

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<math.h>
#include<vector>
#include<algorithm>
#include<limits.h>		//-9223372036854775808

using namespace std;
typedef long long ll;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);

	ll t,n,cur,S,H;
	cin>>t;
	while(t--){
		S=0;
		H=-9223372036854775808;
		cin>>n;
		while(n--){
			cin>>cur;
			if(H==-9223372036854775808){
				H=cur;
			}
			if((cur>0 && H>0) || (cur<0 && H<0)){
				if(cur>H){
					H=cur;
				}
			}
			else{
				S+=H;
				H=cur;
			}
		}
		S+=H;
		cout<<S<<"\n";
	}

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
#ifdef _DEBUG
	FILE* file;
	freopen_s(&file, "input.txt", "r", stdin);
#endif
	int t;
	cin >> t;
	while (t--)
	{
		size_t n;
		cin >> n;
		vector<int> a(n);
		for (size_t i = 0; i < n; ++i)
		{
			cin >> a[i];
		}

		int start = 0;
		int finish = 0;
		long long result = 0;
		bool is_sequence = false;
		for (size_t i = 0; i < n - 1; ++i)
		{
			if ((a[i] >= 0 && a[i + 1] >= 0) || (a[i] < 0 && a[i + 1] < 0))
			{
				finish++;
				is_sequence = true;
			}
			else
			{
				auto part = max_element(&a[start], &a[finish + 1]);
				result += *part;
				start = i + 1;
				finish = i + 1;
				is_sequence = false;
			}
		}

		if ((is_sequence) || (start == a.size() - 1))
		{
			auto part = max_element(begin(a) + start, end(a));
			result += *part;
		}

		cout << result << endl;

	}
}