Contest T-shirts

Segtree has $ M $ contest T-shirts.

He decided to spend $ N $ days on the contest T-shirt alone, and told $ i = 1, 2, 3, \ dots, N $ "$ A_i $ T-shirt on the $ i $ day." I made a plan for $ N $ to wear.

However, if you keep the current plan, you may not be able to do the laundry in time, so I would like to change the plan if necessary so that I will not wear the same clothes for two consecutive days.

Find the minimum number of plans that need to be changed. It can be proved that the conditions can always be met by changing the plan under the given constraints.

input

Input is given from standard input in the following format.


$ M $ $ N $
$ A_1 $ $ A_2 $ $ \ ldots $ $ A_N $


output

Output the minimum number of plans that need to be changed.

However, insert a line break at the end.

Constraint

* $ 2 \ leq M \ leq 10 ^ 9 $
* $ 1 \ leq N \ leq 10 ^ 5 $
* $ 1 \ leq A_i \ leq M $
* All inputs are integers.



Input example 1


twenty three
2 2 1


Output example 1


1


Input example 2


3 6
1 1 1 2 2 3


Output example 2


2






Example

Input

2 3
2 2 1


Output

1
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 100005

enum Type{

	pre_0,
	pre_1,
};

int M,N;
int table[SIZE];
int dp[SIZE][2];


int main(){

	scanf("%d %d",&M,&N);

	for(int i = 0; i < N; i++){

		scanf("%d",&table[i]);
		table[i]--;
	}

	int ans;

	if(M >= 3){

		ans = 0;
		for(int i = 0; i < N-1; i++){

			if(table[i] == table[i+1]){ //i+1を、iとi+2のいずれとも違うシャツにできる
				ans++;
				table[i+1] = -BIG_NUM;
			}
		}

	}else{ //M == 2

		for(int i = 0; i < N; i++){

			dp[i][pre_0] = 0;
			dp[i][pre_1] = 0;
		}

		if(table[0] == 0){

			dp[0][pre_0] = 0;
			dp[0][pre_1] = 1;

		}else{

			dp[0][pre_0] = 1;
			dp[0][pre_1] = 0;
		}

		for(int i = 1; i < N; i++){

			if(table[i] == 0){

				//0のまま
				dp[i][pre_0] = dp[i-1][pre_1];

				//1にする
				dp[i][pre_1] = dp[i-1][pre_0]+1;

			}else{ //table[i] == 1

				//0にする
				dp[i][pre_0] = dp[i-1][pre_1]+1;

				//1のまま
				dp[i][pre_1] = dp[i-1][pre_0];
			}
		}

		ans = min(dp[N-1][pre_0],dp[N-1][pre_1]);
	}

	printf("%d\n",ans);

	return 0;
}

